I have a database with the file names of pictures that I want to display. The pictures aren't necessesarily in id order and they are categorized by 'collection'
I want to be able to run a query or a couple of queries to determine the current picture collection based on the id that is passed along as well as the previous picture in the collection and the next one.
It seems I could do this by running a query on all of the data in the database and then filling it in an array and moving through that to find what I need, but that seems like a lot of work considering I could make 3 queries that would accomplish the same things much quicker witout filling an array with everything in the database. But when I made 3 queries and used the 'fetch_array' it only worked for the first one.
Is there some better way of doing this?
Thanks,
-Jon
I want to be able to run a query or a couple of queries to determine the current picture collection based on the id that is passed along as well as the previous picture in the collection and the next one.
It seems I could do this by running a query on all of the data in the database and then filling it in an array and moving through that to find what I need, but that seems like a lot of work considering I could make 3 queries that would accomplish the same things much quicker witout filling an array with everything in the database. But when I made 3 queries and used the 'fetch_array' it only worked for the first one.
Is there some better way of doing this?
Thanks,
-Jon