Jump to content


mySQL Table results


2 replies to this topic

#1 M24KPM

    Young Padawan

  • Members
  • Pip
  • 6 posts
  • Gender:Male
  • Location:Kenutcky

Posted 30 September 2006 - 10:20 PM

I have a tutorial cataloging system, and I use a mySQL table to show the content in my site. On my main tutorials.php page I have it showing the most recent tutorials, is there a way to make it so it only displays 20 of them and no more than the 20 most recent? ;)

Not sure if this will help but here is what is used to show how to display the tutorials...

$query = "SELECT * FROM tutorials ORDER BY id DESC ";

-M24KPM

#2 Trix06

    Young Padawan

  • Members
  • Pip
  • 292 posts
  • Gender:Male
  • Location:NSW Australia
  • Interests:Web Design & Development, Graphic Design, Programming, Networking, Girls, The Beach, Amatuer Radio Communications and more.

Posted 30 September 2006 - 10:43 PM

Yes you can show the 20 most recent, its simple to do this you use a limit clause like this

$query = "SELECT * FROM tutorials ORDER BY id DESC LIMIT 20";

Somthing like that, if thats not correct someone should be able to help, or type limit sql in google and you will sure find the answer your after.

#3 M24KPM

    Young Padawan

  • Members
  • Pip
  • 6 posts
  • Gender:Male
  • Location:Kenutcky

Posted 01 October 2006 - 05:30 PM

thanks a ton guys! still kinda new to the whole mySQL things. Once again thanks guys! :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users