pgsjoe Posted August 10, 2006 Share Posted August 10, 2006 so I'm already using this....[code] $result = @mysql_query('SELECT * FROM `vince` WHERE `display` = "yes" GROUP BY showdate ASC, pk ASC'); if (!$result) { exit('<p>Error performing query: ' . mysql_error() . '</p>'); }while ($row = mysql_fetch_array($result)) {[/code]to pull from my database. But I only want to return the first 3 results by date. How? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/17088-displaying-a-certain-number-of-items/ Share on other sites More sharing options...
king arthur Posted August 10, 2006 Share Posted August 10, 2006 Add LIMIT 3 on the end of your query. Link to comment https://forums.phpfreaks.com/topic/17088-displaying-a-certain-number-of-items/#findComment-72183 Share on other sites More sharing options...
litebearer Posted August 10, 2006 Share Posted August 10, 2006 perhaps use [b] LIMIT 3[/b]day late dollar short :) Link to comment https://forums.phpfreaks.com/topic/17088-displaying-a-certain-number-of-items/#findComment-72184 Share on other sites More sharing options...
pgsjoe Posted August 10, 2006 Author Share Posted August 10, 2006 I'm not well versed in SQL or PHP! Thanks guys. You rule! Link to comment https://forums.phpfreaks.com/topic/17088-displaying-a-certain-number-of-items/#findComment-72274 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.