1

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ch3vster
  • 13
  • 4
  • Possible duplicate of [Sql where clause not working](http://stackoverflow.com/questions/27202157/sql-where-clause-not-working) – John_West Mar 02 '16 at 00:31

2 Answers2

1

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'
Darshan Mehta
  • 30,102
  • 11
  • 68
  • 102
0

Use = to check for string equality.

SELECT * FROM `Player` WHERE `LogOn` = 'GAME'

Please note ' for string quotes in mysql.

bolav
  • 6,938
  • 2
  • 18
  • 42