note 34568 deleted from function.mysql-query by didou
| From: | didou@php.net | Date: | Thu, 31 Jul 2003 09:10:25 +0000 |
| Subject: | note 34568 deleted from function.mysql-query by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53058@lists.php.net to get a copy of this message | ||
Note Submitter: Jeroen (Sweden)
----
If you want to limit your mysql_query, like when publishing the latest news but you only want to
publish the 5 newest ones. Then use the LIMIT command but be sure to -
!!! call it last in the query !!! -
otherwise you will get a error like this:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\file.php
on line #
example:
wrong -
mysql_query = ("SELECT * FROM news LIMIT 5 ORDER BY timestamp DESC")
rigth -
mysql_query = ("SELECT * FROM news ORDER BY timestamp DESC LIMIT 5 ")