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
[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
> $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:
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 3.23.39. I ha
[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