You are here: Re: selecting only a certain number of bits of data « PHP Programming Language « IT news, forums, messages
Re: selecting only a certain number of bits of data

Posted by Tyno Gendo on 04/16/07 10:18

roondog wrote:
> I have just started learning php and mysql. I am trying to make a news page
> for a site where you can enter news in a form and it appears on the news
> page. That is done, fairly simple. I've also ordered them with the latest
> first. I would now like to only show a certain number of the news articles.
> Say the latest five. Each article is numbered so I guess I would use that
> but i'm not really sure how to do it. Any ideas?
>
>
>

If you have a date field you can order by date descending, but ID is
fine if you happy with that... so...

SELECT * FROM news ORDER BY news_id DESC LIMIT 5

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация