Page 1 of 1

syntax error

Posted: Tue Aug 28, 2007 11:24 am
by Faithe
Well, after searching around the forums a bit, I found nothing that successfully solved the problem, so hopefully posting about it will do the trick :] It seems simple enough, but I can't figure out why it won't work.

Code: Select all

$query = mysql_query("SELECT * FROM bmem WHERE bmid =". $_SESSION['id']. "ORDER BY Rand() LIMIT 15");
That's the line the error message specifies, saying "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 'BY Rand() LIMIT 15' at line 1"

It'd be great if someone could point out what i'm doing wrong :]

Thanks.

Posted: Tue Aug 28, 2007 11:35 am
by VladSun
Put a space between ORDER and the quote.

Posted: Tue Aug 28, 2007 11:36 am
by Faithe
;] thanks.