+ 3
PHP and SQL
Good evening, readers. Faced with such a problem that the code with SQL data validation in the PHP programming language simply does not work, no error - nothing. I need to take the columns where the rating of the game is more than 7 races and display it on the screen, and it does not display. The code will be checked below. $sql = "SELECT * FROM 'horrors' WHERE 'Rate Game' < 6"; echo $sql;
3 Réponses
+ 2
Maybe try to change the condition to > 7 (not < 6)
And use back ticks e.g. `quoted` rather than single quote e.g. 'quoted' for enclosing table and field name.
+ 2
No, it doesn't. I suspect that echo($sql); is used incorrectly. Can mysql_result do it?
+ 1
Basically the column name should not contains space, it is not a best practice. Anyhow check this query “SELECT * FROM ‘horrors’ WHERE `Race Game` > 7