Problem with Update
Posted: Sun Nov 02, 2008 8:16 pm
Hi ALL
Can anyone help me on this query please, all I'm trying to do is Update three tables in a same query.
Thanks Zed
Can anyone help me on this query please, all I'm trying to do is Update three tables in a same query.
Code: Select all
if($_POST['submit']) {
foreach($_POST as $job_id) {
mysql_query("UPDATE job_tb,blockbook,blockbook2 SET
job_tb.cust_address = 'Cancel'
blockbook.cust_address = 'Cancel'
blockbook2.cust_address1 = 'Cancel'
WHERE job_tb.job_id = '$job_id'
AND blockbook.job_id = '$job_id'
AND blockbook2.job_id = '$job_id'");
if (mysql_affected_rows() > 0) { // execute query
print "<font color=red size=2> No. = $job_id has been Updated</font><p>";
}
}
}