PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
[color=#4000BF]$query = "SELECT * FROM js_profile WHERE category ='$category', years_exp = '$years_exp',
degree ='$degree', work_time ='$work_time', available ='$available' LIMIT 0, 2000 ";
$result = mysql_query($query) or die(mysql_error());[/color]
Here is the 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 ' years_exp = '', degree ='', work_time ='', available ='' LIMIT 0, 2000' at line 1
$query = "SELECT * FROM js_profile WHERE category ='$category' AND years_exp = '$years_exp' AND
degree ='$degree' AND work_time ='$work_time' AND available ='$available' LIMIT 0, 2000 ";
jayshields wrote:Use AND instead of commas for seperating up your WHERE clause.
or OR
cap2cap10 wrote: Here is the 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 ' years_exp = '', degree ='', work_time ='', available ='' LIMIT 0, 2000' at line 1
Since SQL reports the query as years_exp='' and degree='' etc, are you sure that $years_exp and $degree etc actually contain values? (the query itself would still be valid (besides the commas) with empty strings, but it's probably not what you intended)