Jump to content

MYSQL Query LIMIT 2


Foser

Recommended Posts

$query = mysql_query("SELECT `post_subject`, post_text FROM `phpbb_posts` WHERE `forum_id` = 2 ORDER by `post_id` DESC LIMIT 2");
$article = mysql_fetch_assoc($query);

this is what I have. I'd like to keep it assoc but if it's easier another way I'm flexible for it.

 

I would know how to echo it out in normal if it was limit 1 but as limit 2 how can I differentiate from $article['post_subject'] (for first in order) and $article['post_subject'](from limit two)

 

thanks, any help is greatly appreciated!

 

 

Link to comment
https://forums.phpfreaks.com/topic/88902-mysql-query-limit-2/
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.