Jump to content

mysql select top error


razvypp

Recommended Posts

can any one tell me why i get error ?

$s = "Select  * from chat_global order by id ASC"; (works)

but as soon as i add 'Top 3' ,like below

 

$s = "Select  Top 3 * from chat_global order by id ASC";

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 '3 * from chat_global order by id ASC' at line 1

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in Q:\www\chat.php on line 24

Link to comment
https://forums.phpfreaks.com/topic/197994-mysql-select-top-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.