Small Mysql Problem

  • From: BlueScale <bluescale1976@xxxxxxx>
  • To: "programmingblind@xxxxxxxxxxxxx" <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 05 Sep 2008 23:02:12 -0400

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

Other related posts: