|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
VlastV Smarty n00b
Joined: 30 Oct 2004 Posts: 1 Location: Russia
|
Posted: Sat Oct 30, 2004 11:19 am Post subject: Реале& |
|
|
Все новости хранятся в базе данных MySQL. Надо на странице выводит допустим по 10 новостей. Как лучше реалезовать и в плане скорости и в плане ресурсов? |
|
Back to top |
|
PbIXTOP Smarty n00b
Joined: 08 May 2006 Posts: 1 Location: Russia, Angarsk
|
Posted: Mon May 08, 2006 11:26 am Post subject: |
|
|
Лично я делаю так
Code: |
$page=$_GET['page'];//получение номера страницы
$result=mysql_query("select COUNT(*) from news");
$count=mysql_fetch_row($result) OR 0;
$count=$count[0];
$news_num=10; //Количество новостей на странице
$result = mysql_query("select * from news limit ".($page-1)*$news_num.",".$news_num);
|
|
|
Back to top |
|
kost Smarty Rookie
Joined: 24 Jan 2006 Posts: 33 Location: Kiev, Ukraine
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|