Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit 1

Status
Not open for further replies.
Jun 9, 2004
188
US
Hello. If I want to output id's 4 5 10 and 15 via a mysql_fetch_array. Would I use Limit. Something like what I ahve below?

$query="SELECT id, title, description FROM article ORDER BY id DESC LIMIT 4,5,10,15";
$result=mysql_query($query);
while($rst=mysql_fetch_array($result))

blah blah the rest.

Thanks in advance.
 
Your SQL should look something like:
Code:
SELECT id, title, description
FROM article
WHERE id IN ( 4, 5, 10, 15 )
ORDER BY id DESC

Andrew
Hampshire, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top