PHP / MySQL image slideshows for directory listings
-
I am building a business directory using php/mysql and am wondering what would be the best way to set up image slideshows for the advanced business listings? I have a mysql database of business information (over a thousand businesses) which is likely to expand in the future so I need a solution that is manageable when scaled up. I was thinking along the lines of creating image folders for each business and then adding a series of thumbnails and full size images to this folder. I would then add the url for each image to a separate column in my business info table in my database. I could then use php to call the image url's from the database to insert into my page layout and control the functionality with a nice jquery effect. Does that sound realistic?
-
Answer:
I'm not sure how many images there are per business and if there is any special advantage to creating a folder per business, especially if you are going to have thousands in the future. It is very likely a good idea to have some full size images and some pre-built thumbnails, especially if you don't have too much user-driven photo uploading or at least if your uploading process includes the ability to automate the thumbnail generation. Keeping the URL of the thumbnail and the full size picture in your table is a good idea. If you have multiple photos per business then you'd obviously want a child table that contains a foreign key to the business table and then the details of each photo for any particular business. If you're arranging a slide show, this child table would be where you could keep sequence information as well as anything else that might be of interest, such as a description or image caption. There are some sites, like IMDB, that go a step further and virtualize the path to pictures. I think this must be a defense against scraping photos out of a site. If the real addresses of the photos are hard to guess, and if the photos can be served up by an http handler then you can build your pages so that the folders containing your photos are never truly revealed in your rendered HTML. Depending on the sensitivity of your photos, you can decide whether this layer of abstraction is worthwhile.
Richard Bell at Stack Overflow Visit the source
Related Q & A:
- How to store an image in database using MySQL?Best solution by stackoverflow.com
- How to prevent duplicate entries in MySQL and PHP?Best solution by Stack Overflow
- How to write a query for PHP and MySQL?Best solution by Stack Overflow
- How to Display an Image in PDF, which is retrieved from MySql Database :JSP and iText?Best solution by Stack Overflow
- How to create a table in PHP with MySQL?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.