Jump to content


Photo

MYSQL Error :/


  • This topic is locked This topic is locked
3 replies to this topic

#1 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 21 September 2006 - 07:31 PM

Hey Guys.
I have a small problem with my SQL query, the error is:
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

The code / sql line is:
$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().'');

does anyone know any problems? I checked few times,
tried renaming my syntax :/ nothings changed.

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 21 September 2006 - 07:33 PM

Change it to:
SELECT * FROM pm_buddy WHERE user_name='{$_SESSION['username']['usr_user']}' AND inf_accept='2' AND inf_block='y' AND inf_friend='n'


#3 xyn

xyn
  • Members
  • PipPipPip
  • Advanced Member
  • 779 posts
  • LocationNorthampton

Posted 21 September 2006 - 07:35 PM

Sorry i just noticed what you did, i left out an "AND" between the user and the inf_accept...
thanks

#4 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 21 September 2006 - 07:38 PM

What error do the query I showed you give?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users