$result53543534 = mysql_query("UPDATE users SET credit=credit+1 WHERE email= '{$battle_get['username']}'")
or die(mysql_error());
But does not update. checked $battle_get['username']
and the username is in there.
i am not getting any errors or anything just not adding...
Any help would be very nice thanks in advance
The symbol <> in MySQL is same as not equal to operator (!=). Both gives the result in boolean or tinyint(1). If the condition becomes true, then the result will be 1 otherwise 0. Case 1 − Using != operator.
Description. The MySQL NOT Condition (also called the NOT Operator) is used to negate a condition in a SELECT, INSERT, UPDATE, or DELETE statement.
If your MS Access update query fails to change the table's data, then the very first thing you need to check is; Whether the underlying Access table is updatable or not. To check this, you just need to open your Access table and try to edit the fields manually.
In MySQL, you can use the <> or != operators to test for inequality in a query. For example, we could test for inequality using the <> operator, as follows: SELECT * FROM contacts WHERE last_name <> 'Johnson';
See what the result from mysql_affected_rows()
is:
if ( ! $result53543534 = mysql_query( "UPDATE users SET credit=credit+1 WHERE email= '{$battle_get['username']}'") ) {
die( mysql_error() );
} else {
echo "Number of rows affected: " . mysql_affected_rows() . "<br>";
}
I may not have the syntax completely right but I hope you get the idea. If the result is 0, you're not specifying the WHERE
syntax so that it actually refers to any row(s).
If the result is greater than 0, then you're mistaken if you think it's not affecting any rows. It may not be affecting the rows you think it should, but that's another issue.
Also, echo
your sql statement so you can actually see exactly what it's doing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With