• 0

SQL n php help


Question

hello, i dont know how to explain so im going to give examples of what i want done to see if you could help me today :)

i want to create a photo album on my website but i want it to grab all the information from the DB and then set up next and previous links to pictures.... what i dont know how to do is make the links ... i need examples of how to make links... none of the ids will be one after the other... it will be all users in one table.... so it will need to grab ids like 45546 and 65870 any help please

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

You need to explain your problem clearly; your post is too vague.

If you fetch "all the information" from the database, you might have an array of image id's. But you've told us nothing about how your database table is designed. The "next" image depends on what your next image is supposed to be; you haven't told us how the images are supposed to be ordered. Lots of missing information.

You make links like this: <a href="LINK">TEXT</a>

You make images like this: <img src="IMAGE" />

Link to comment
Share on other sites

  • 0

ok lol true im actually a fair level with php... i mean i need to grab the images but i need to create the next link using the mysql fetch array ... simple enough to get the pic info but the link will be (http://www.website.com/images.php?userid=1&imageid=2 )

the problem i am having is working out how to get the next link to be the next picture in the table ... so if the next picture id for user 1 is 1000 then i cant do a simple $imageid = ($imageid, ++1); as that would only be 3 .... you getting me now?

Link to comment
Share on other sites

  • 0

im looking in to "pagination" now :p but you wouldnt be able to help me by like just giving me a small snippet of code :D its like all i need is a small paragraph to get my code working :'(

Link to comment
Share on other sites

  • 0

there are some handy pre written PHP Pagenation classes you can get that will do this for you, unfortunately you will have to google for these. Shouldnt be too hard.

Link to comment
Share on other sites

  • 0

im looking in to "pagination" now :p but you wouldnt be able to help me by like just giving me a small snippet of code :D its like all i need is a small paragraph to get my code working :'(

I helped you already, if I give you the code I'm going beyond help ;)

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.