Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

Query UPDATE report

I have a script that updates a database.  It updates about 100 field from information that is being parsed from a feed.  What type of query code would I need to write so that the UPDATE that ran would report to me the fields that were updated?
Avatar of nanharbison
nanharbison
Flag of United States of America image

can you give us the update query as it is written now?
Avatar of Robert Granlund

ASKER

@nanharbison

$q = "UPDATE exp_weblog_data SET field_id_29='$field_id_29', field_id_30='$field_id_30', field_id_31='$field_id_31'  WHERE field_id_215='$field_id_215'";


ASKER CERTIFIED SOLUTION
Avatar of nanharbison
nanharbison
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Do you know how to send email in PHP? You could include the values you updated if you want to see them.
I want to print the return on screen.  Can I echo $q?
Absolutely, you can echo the query!
You can do this
$q = "UPDATE exp_weblog_data SET field_id_29='$field_id_29', field_id_30='$field_id_30', field_id_31='$field_id_31'  WHERE field_id_215='$field_id_215'"; 

if ($return = mysql_query($q, $yourconnection))
{
	echo $q;
)

Open in new window