I am trying to check to see if a condition exists before executing a mysql update. This code below WORKS:
if (!mysql_query(
"UPDATE customers SET available_credit = available_credit where userid = '$userid';"
))
{
die('Sorry, a database error occurred');
}
...but I'm trying to add another condition to it like this:
if (!mysql_query && ($tradein_status == 'Accepted CREDIT')(
"UPDATE customers SET available_credit = available_credit where userid = '$userid';"
))
{
die('Sorry, a database error occurred');
}
..which DOESN'T work - it generates this error: "Parse error: syntax error, unexpected '(' in /home/bohemeth/public_html/tradeins/save_tradeins.php on line 235"
The second thing I am wondering is why is this part:
if (!mysql_query(
"UPDATE customers SET available_credit = available_credit where userid = '$userid';"
))
...not written with two parens and curly braces after the condition, which it seems you would do anywhere else for a conditional test, like so:
if (!mysql_query){
"UPDATE customers SET available_credit = available_credit where userid = '$userid';"
}
THANK you for any help!!