Jump to content

Need Help Pagination please!!!


Techmate

Recommended Posts

Not sure if I am following you anymore but if I am, I dont know if I can make more clear example than this.

Say you have data in database like below

 

table : user_created_galleries_in_db

id  |  gallery_name

---------------------------------

1    |  Cars   

2    |  Store

3    |  Something

 

table : images

id  |  image  |    gallery_id (references to user_created_galleries_in_db(id))

-----------------------------------------------------------------------------

1    |    car1.jpg |    1

2    |    car2.jpg |    1

3    |    car3.jpg |    1

 

Then this is how you show images from gallery

// Sql for creating the links to the page
$sql = "SELECT id, gallery_name FROM table user_created_links_in_db";
$result = mysql_query($sql);

// Generate the liks from user created galleries from db
while($row = mysql_fetch_assoc($result))
{
echo '<a href="gallery_id='. $row['id'] .'">'. $row['gallery_name'] .'</a></br>';
}

// Now if user clicks gallery link, show the data related to that gallery
if (isset($_GET['gallery']) && intval($_GET['callery_id']) > 0)
{
$galleryId = intval($_GET['gallery_id']);
$sql = "SELECT image FROM images WHERE gallery_id = $galleryId";
$result = mysql_query($sql);

// Show images in clicked glalery
while($row = mysql_fetch_assoc($result))
{
	// Show image data
}
}

 

So you have the idea of categories but,  I updated my database and tables, colums based on what you  your script but I am conflicted. The script is incomplete and I don't see were to include my pagination script. Could you incorporate a completed script with pagination that works with categories.

 

Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.