Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Efficiency of displaying images from db

Featured Replies

Have been working on many things lately, probably the most challenging is a script I wrote that displays live text updates of a football match. It uses a desktop app I wrote in VB to input data to the mysql DB and uses AJAX and PHP to send and retreive information.

 

I'm having a problem, well maybe not a problem as such but need peoples views on the most efficent way to display the teams badges on the page. As the teams obviously change every match its not just a case of sticking a couple of images directly in the page. There is an option on the desktop app I wrote which lets you pick the teams. This all works fine but how best can I display the images. Do you think storing them in the DB (they are small only 25*25px) or store values in the DB and maybe have a javascript array with all the images and use the stored values to choose the correct image. If javascript is turned off the names are still displayed so this is not a problem.

 

Although I have self taught myself the basics of using mysql but my knowledge of working with images is not great. I can get it to work as i wish but don't know if it is the most efficient method of doing what I want. Maybe I could just store the url of the image in the DB, i'm kinda stuck choosing which way to go.

 

Any thoughts.

As I see it every database request slows a site down so the less you store in there the quicker the site will be, IMHO you'd be better off putting the image URL into the database and storing the images separately in a folder.

 

The image URL would be associated with the team so all you'd do is call in the approripate URL when displaying the page...

I agree 100%

 

Store the URL not the image, it will cut the load on the database.

  • Author

Ye was playing about with the ideas last night and storing the url seemed to be the better option. Thanks guys.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.