PDA

View Full Version : Syntax error help


jewel531
10-13-2010, 01:53 PM
I am having a problem with a syntax error for a facebook application I'm trying to install.

Invalid query -- SELECT * FROM `results` WHERE `resultLow`<= AND `resultHigh`>= -- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND `resultHigh`>=' at line 1

I'm just learning programming and I can't figure out how to fix this.

I can send all the code, and I'm sure it will take someone who knows what they are doing 5 minutes to fix.

Can anyone help me

edbr
10-14-2010, 02:22 AM
WHERE `resultLow`<=
`resultHigh`>='
there are no values mentioned here
example
select * from results where `resultHigh` <= 2;

davidj
10-15-2010, 04:08 PM
I wouldn't use back ticks

Its not wrong but can lead to debug issues later on.

It allows you to name your columns anything you want to. You could have a column called DROP or SELECT and then in your SQL you would use back ticks to reference them

SELECT * FROM `SELECT` WHERE `DROP`=....

A right hornets nest