Re: ORDER BY RAND() not working

2002-07-12 Thread Arthur Fuller
ER BY MyOrder; hth, Arthur - Original Message - From: "Jamie Tibbetts" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 11, 2002 1:14 PM Subject: Re: ORDER BY RAND() not working > > $id = mysql_query("SELECT * FROM products WHERE sale_price

RE: ORDER BY RAND() not working

2002-07-11 Thread Jay Blanchard
[snip] PHP code: $result = mysql_query("SELECT * FROM products WHERE sale_price IS NOT NULL ORDER BY RAND() LIMIT 3") or die(mysql_error()); The error message is as follows: You have an error in your SQL syntax near 'RAND() LIMIT 3' at line 1 [/snip] Using; $query = "select * from tblBAR WHERE

Re: ORDER BY RAND() not working

2002-07-11 Thread Jamie Tibbetts
> $id = mysql_query("SELECT * FROM products WHERE sale_price IS NOT NULL ORDER > BY RAND() LIMIT 3",$link) or die(mysql_error()); PHP code: $result = mysql_query("SELECT * FROM products WHERE sale_price IS NOT NULL ORDER BY RAND() LIMIT 3") or die(mysql_error()); The error message is as follows:

RE: ORDER BY RAND() not working

2002-07-11 Thread Alain Fontaine
What does your PHP code look like ? It might be a syntax problem inside PHP -Message d'origine- De : Jamie Tibbetts [mailto:[EMAIL PROTECTED]] Envoye : jeudi 11 juillet 2002 18:22 A : [EMAIL PROTECTED] Objet : ORDER BY RAND() not working I'm running PHP 4.1.2 and MySQL

RE: ORDER BY RAND() not working

2002-07-11 Thread Jay Blanchard
[snip] I'm running PHP 4.1.2 and MySQL 3.23.39. I have a simple query that works if I telnet into MySQL and run the query manually. If I try and use it in a PHP page, I get the "Supplied argument is not a valid MySQL result resource" error. However, if I take out the ORDER BY RAND() part from the

ORDER BY RAND() not working

2002-07-11 Thread Jamie Tibbetts
I'm running PHP 4.1.2 and MySQL 3.23.39. I have a simple query that works if I telnet into MySQL and run the query manually. If I try and use it in a PHP page, I get the "Supplied argument is not a valid MySQL result resource" error. However, if I take out the ORDER BY RAND() part from the query,