I’d like to add in another field next to the Lodge field, complicated by the fact that its to display an image. (The field is winner10, and just contains the string winner10.gif which references the gif.)
And I have a non PHP issue of spacing the icons out equally. I’ve created a 1x1px spacer.gif to avoid showing the blue boxed ? where no image is found. But that results in differing gaps depending on which icons a record will have next to it.
The ordering must be done in the query that extracts the data from the database (ORDER BY).
And if you want to add from 0-3 images, then don’t use a “fixed” line, but put it together using if’s to check which images you want to add.
Thanks - I’m used to just having my queries just order by one field, so I’ve just changed my query to :
SELECT * FROM lodges ORDER BY Alphabet, Lodge Asc
and that seems to have fixed that, so that was painless enough.
The images thing I’m less sure about. I get the idea - presumably its a series of IF… checking if the field is NULL or not, and if so, to display the image?
Yes exactly that :tup:
Also one thing about your query, be specific as to what fields to retrieve from the database instead of using * to get EVERYTHING EVERYTIME it is is queried.
Saves time, resources and its easier to manipulate.
Yeah - I’ve read that before about the queries - old habits and all!
I’ve also had a rethink about the icons - instead of having specific fields for each year’s winner, runner up etc, I’ll just create ten or so awards fields that can be populated with whichever text is required. That way, there won’t be any gaps in the spacing.