You need to use params to the in() function. Octavian----- Original Message ----- From: "BlueScale" <bluescale1976@xxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx> Sent: Saturday, September 06, 2008 6:02 AM Subject: Small Mysql Problem
Hi, I have a mysql statement that is not working. I am not sure why because I have one in another place that is almost the same thing that works fine. Here's my code: $sql = "SELECT member_id FROM members WHERE member_id NOT IN " . substr($exclude, 0, strlen($exclude) - 2) . " ORDER BY Rand() LIMIT 4"; The error I am getting is: 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 '101, 100 ORDER BY Rand() LIMIT 4' at line 1 Thanks for the help. BlueScale
__________View the list's information and change your settings at //www.freelists.org/list/programmingblind