If the mysql table for the gallery looks like:
id | pic1 | pic2 | pic3 | pic4
-------------------------------------------------------------
1 | | b.jpg | c.jpg | d.jpg
How can I select the first non empty pic value from columns pic1, pic2, pic3, pic4 for the gallery with id=1?
In example above it will be value from the pic2 column (b.jpg)
backup.gifwill be returned if all are empty. This also assumed that by empty the columns are NULL.