Jump to content


Photo

displaying a certain number of items....


  • Please log in to reply
3 replies to this topic

#1 pgsjoe

pgsjoe
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 10 August 2006 - 01:11 AM

so I'm already using this....
  $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)) {

to pull from my database. But I only want to return the first 3 results by date. How? Thanks in advance.

#2 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 10 August 2006 - 01:13 AM

Add LIMIT 3 on the end of your query.
Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.

#3 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 10 August 2006 - 01:14 AM

perhaps use    LIMIT 3

day late dollar short :)

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

#4 pgsjoe

pgsjoe
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 10 August 2006 - 04:35 AM

I'm not well versed in SQL or PHP! Thanks guys. You rule!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users