Jump to content

[SOLVED] LIMIT tag


Zoud

Recommended Posts

I have a little question. Were would I enter the LIMIT 0 , 5 tag on the coding below?

<?php
mysql_select_db("database", $con);
$result = mysql_query("SELECT * FROM news ORDER BY id DESC");

while($row = mysql_fetch_array($result)){
?>

 

I've tried the following:

SELECT * FROM news LIMIT 0 , 5 ORDER BY id DESC

SELECT * FROM news ORDER BY id LIMIT 0 , 5 DESC

SELECT * FROM news ORDER BY id DESC LIMIT 0 , 5

 

I need it so it will only show the last 5 that were inserted, but I tested each one and they'll eather show all or none.

Link to comment
https://forums.phpfreaks.com/topic/44656-solved-limit-tag/
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.