You are here: Re: How could I paginate the result set? « PHP Programming Language « IT news, forums, messages
Re: How could I paginate the result set?

Posted by Tyno Gendo on 04/19/07 10:06

Tyno Gendo wrote:
<snip>
>
> $sql = "SELECT cr.catID, cat_title, recipeID, recipe_title
> FROM catrecipe cr, recipe
> WHERE cr.catID = recipe.catID AND cr.catID = " . (int)$cat_id .
> " ORDER BY recipeID DESC LIMIT {$start}, {$end}";
> $ds = mysql_query($sql) or trigger_error("Unable to query database: "
> . mysql_error());

note that my $page var is 0 based. so if you display page to the user,
use $page+1 so it doesn't say 'You are viewing Page 0' :)

 

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

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