Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming Logic Question

Status
Not open for further replies.

Programz8

Programmer
Mar 27, 2007
33
0
0
US
Hello Everyone, I have a question I don't have any code yet because I haven't begun to program this yet I'm just trying to get the logic down packed prior to starting. Here is my question:

If I use an array to return a result set from a mysql database how can I display the results where I want them. For example if I am displaying 5 pictures on a row and there are 10 pictures on the database how do I get pictures 6 through 10 on the second row. And expanding on this idea what about a limit of say 20 pictures per page with a database that has 40 pictures how can I then direct the left over pictures to the next page.

Right now I'm going to program a separate DB for every 5 pictures but I know there has to be a better way. I know I don't have code but I'm looking only for ideas so I can try to code it myself. Any ideas and/or suggestions are more than welcome. Thanks

Programz
 
Look at faq434-5244 for pagination (having 20 of 40 records per page. As for your first request, I would suggest you simply float the results. Floating will automatically do what you want. The elements will wrap onto next line after they will no longer fit. And with the size of parent container and sizes and margins of the results you can control how many will fit in one row.
 
No I didn't check that FAQ otherwise I wouldn't have posted this. lol. I did use the search but of course my search terms weren't exact and didn't pick up the FAQ. Thanks for the help, I appreciate every response I get.

Programz.
 
have a look at cssplay.co.uk for some neat ways of styling photo galleries. (no affiliation by me but i think his stuff is really good)
 
Nice link jpadie, thanks for sharing.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top