Jump to content

Truncating whole entries


matthew798

Recommended Posts

Hey boys!!

 

I have an admin panel, and i made it so that someone an login and post news. Everything works fine and dandy, but after about 20 news postings, the page gets pretty long... lol..

 

I have it set up like this:

 

mysql_query("INSERT INTO news 
(`title`, `body`, `date`) VALUES ('Timmy Mellowman', '23', now())")  
or die(mysql_error()); 

 

It's all nice and formatted with html when it draws the info..

 

Only thing i want is to knwo if it's possible to take only say, 5 of the most recet database entries (i already have it set to sort by ID in a DESC order, so the news stories are in order). Basically, omit anything after it reaches 5 postings. Is there a way to do that?

Link to comment
https://forums.phpfreaks.com/topic/123462-truncating-whole-entries/
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.