xyn Posted September 21, 2006 Share Posted September 21, 2006 Hey Guys.I have a small problem with my SQL query, the error is:[color=red]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 'inf_accept='1' AND inf_block='n' AND inf_friend='y'' at line 1[/color]The code / sql line is:[color=red]$sql = mysql_query("SELECT * FROM pm_buddy WHERE user_name='{$_SESSION['username']['usr_user']}' inf_accept='2' AND inf_block='y' AND inf_friend='n'")or die('ERROR:'.mysql_error().'');[/color]does anyone know any problems? I checked few times,tried renaming my syntax :/ nothings changed. Link to comment https://forums.phpfreaks.com/topic/21568-mysql-error/ Share on other sites More sharing options...
Daniel0 Posted September 21, 2006 Share Posted September 21, 2006 Change it to:[code]SELECT * FROM pm_buddy WHERE user_name='{$_SESSION['username']['usr_user']}' AND inf_accept='2' AND inf_block='y' AND inf_friend='n'[/code] Link to comment https://forums.phpfreaks.com/topic/21568-mysql-error/#findComment-96269 Share on other sites More sharing options...
xyn Posted September 21, 2006 Author Share Posted September 21, 2006 Sorry i just noticed what you did, i left out an "AND" between the user and the inf_accept...thanks Link to comment https://forums.phpfreaks.com/topic/21568-mysql-error/#findComment-96272 Share on other sites More sharing options...
Daniel0 Posted September 21, 2006 Share Posted September 21, 2006 What error do the query I showed you give? Link to comment https://forums.phpfreaks.com/topic/21568-mysql-error/#findComment-96274 Share on other sites More sharing options...
Recommended Posts