you are probably using MySQL3.* in which case you have to make 2 queries...
1 to find out how many 'pages' you have & one to fetch $x pages worth of content for this page which you do using LIMIT
//query to count the pages//
$yaks=mysql_query("SELECT count(id) from $table);
//number of pages we have in total//
//query for thispage data//
$yaks=mysql_query("SELECT * FROM $table LIMIT $_GET[from],$perpage);
not going into details but now you build your pages menu and you would normally construct this in a loop... //for $x=0;$x<$pages;$x++ ..... etc to create...
<a href="<?=$_SERVER['PHP_SELF']?from=0">page 1</a>
<a href="<?=$_SERVER['PHP_SELF']?from=20">page 2</a>
thats the basics of it anyway, with MySQL 4 (if ever released as stable) - you can alledgedly do this...
$sql = "Select SQL_CALC_FOUND_ROWS,* from $table limit 0,20";
which returns not only your first 20 rows, but also the count of all rows, not that I have tried it but thats whats supposed to happen.
MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
Last edited by firepages; 08-20-2002 at 08:05 AM..