views:

56

answers:

3

Hello, I get the following syntax error

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 '* ,MATCH(city) AGAINST ('""' IN BOOLEAN MODE) FROM `` WHERE MATCH(city) AGAINST ' at line 1

The corresponding code for this error is the following:

$sql = mysql_query("SELECT $s.* ,MATCH(city) AGAINST ('\"$c\"' IN BOOLEAN MODE) FROM `$s` WHERE MATCH(city) AGAINST ('\"$c\"' IN BOOLEAN MODE )  Group by company ASC") or die (mysql_error()); 

Is it possible to tell me what is the error on the query? I don't have enought MySQL experience.

Thanks

+4  A: 

Looks like your variables $s and $c don't have values.

Eric Petroelje
A: 

Try echoing the string that you're putting into the mysql_query function, and post the results.

TheAdamGaskins
+2  A: 

$s seems to be empty - as you can see in the error message ("[...] FROM `` WHERE [...]")

EDIT: $c is empty, too.

oezi