Jump to content

Pagination for MySQL Database


mmmissymunchkin

Recommended Posts

I need some help with creating Pagination for my database. I've been looking for hours for tutorials or some kind of help with this and have found nothing :(

 

I have it set up on this page here http://deliquesce.co.cc/pages/graphics/icons.php

 

And this is the Code I have

<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("****", "****", "***"); 

//select which database you want to edit
mysql_select_db("a3441820_graphic"); 


//select the table
$result = mysql_query("SELECT * FROM `icons` LIMIT 24");


//grab all the content
while($r=mysql_fetch_array($result))
{	
   //the format is $variable = $r["icons"];
   //modify these to match your mysql table columns
  
   $id=$r["id"];
   $iconimg=$r["iconimg"];
   
//display the row
   echo "<img id=icons src=$iconimg></img>";
}
?>

 

This works perfectly fine until I try to combine it with the coding for the pagination. Does anyone know how I can get this to work properly or direct me to a tutorial that will show me how to create a proper display of my MySQL data with the pagination?

Link to comment
https://forums.phpfreaks.com/topic/196724-pagination-for-mysql-database/
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.