Could you send a copy of the line that works? it apparently doesn't like your use of rand(). --le ----- Original Message ----- From: BlueScale To: programmingblind@xxxxxxxxxxxxx Sent: Friday, September 05, 2008 10:02 PM 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