Hi. I have the following code:
if (isset($id) && isset($pend)) {
if ($pend == 1) {
mysql_query ("UPDATE orders SET pending = 1 WHERE id = '$id'") or show_error(mysql_error());
show_msg("Order status is now pending", "$PHP_SELF");
} elseif ($pend == 0) {
$today = date("Ymd H:i:s");
mysql_query ("UPDATE orders SET pending = 0 AND exec_date = '$today' WHERE id = '$id'") or show_error(mysql_error());
show_msg("Order status is now processed", "$PHP_SELF");
}
}
I get here from:
"href=\"$PHP_SELF?id=$id&pend=1\"
The strange thing is that the mysql command is not doing anything. And i'm sure it's ok because it's copy/paste 🙂
I'm getting into and run the query because if i change the field getting updated i get an error.
The pending field in the db is tinyint(1).
What's wrong?
Thanks.