Jump to content
php.lv forumi

PDO statement query to randomize last 10 rows


goma smile

Recommended Posts

SELECT * FROM (items ORDER BY item_id DESC LIMIT 10) ORDER BY RAND() 

 

izmet erroru 

 


Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'ORDER BY RAND()' at line 1' in C:\AppServ\www\index.php:27 Stack trace: #0 C:\AppServ\www\index.php(27): PDOStatement->execute() #1 {main} thrown in

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...