Reputation: 13
I have this piece of code
$player = mysql_query("SELECT * FROM `Player` WHERE `LogOn` ? `GAME`")
or die(mysql_error());
My issue is where I placed question mark, I need to have it so it would be Login is equal to GAME. I probably would of found the answer by searching the web, but I lack the English words.
Upvotes: 1
Views: 51
Reputation: 30839
Here's what you need:
SELECT * FROM `Player` WHERE `LogOn` = 'GAME'
You can use upper() for case insensitive check:
SELECT * FROM `Player` WHERE upper(LogOn) = 'GAME'
Upvotes: 1
Reputation: 6998
Use =
to check for string equality.
SELECT * FROM `Player` WHERE `LogOn` = 'GAME'
Please note '
for string quotes in mysql.
Upvotes: 0