Quote:
Originally Posted by Seif_
You can't use ` and ' in the same query, it will return an error.
|
For PHP, yes you can.
Quote:
Originally Posted by Seif_
Quote:
Originally Posted by Gabe
There cannot be spaces in field names as said above.
The proper syntax would be:
PHP код:
mysql_query('UPDATE `users` SET AdminLevel = "1" WHERE Username = "'.$user.'"');
And then the check would be:
Код:
$query4 = mysql_query('UPDATE `users` SET AdminLevel = "1" WHERE Username = "'.$user.'"');
if(!mysql_query($query4))
{
echo mysql_error();
}
or
Код:
if(mysql_query($query4) == 0)
{
code
}
|
Why use mysql_query again? I think you can just do:
PHP код:
$query4 = mysql_query('UPDATE users SET AdminLevel = 1 WHERE Username = "'.$user.'"'); if (!$query4) { echo mysql_error(); }
|
You can. I wasn't even paying attention to that. I was just going off of what was already typed.
Edited original post.