Robert Granlund
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?
can you give us the update query as it is written now?
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_21 5'";
$q = "UPDATE exp_weblog_data SET field_id_29='$field_id_29'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you know how to send email in PHP? You could include the values you updated if you want to see them.
ASKER
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;
)