I have a photos table in the database that uses a status column to detect if the photo was validated or not...
so if a photo has a status = 0 then its not validated, but if status = 1 then the photo was validated.
I want to add status = 2 for selecting the photo as the 'main photo' so I can use
SELECT photo WHERE status = 2
but if there is no 'main photo' selected I want to select any other photo, but give priority to a photo with a status = 2 if available.. so I want to use something like this:
SELECT photo WHERE status = 2 OR status != 2
.. but giving priority to the photo with status 2... so if there is a photo with status 2 it will select that photo, but if there is't then can select any photo...
Its possible to do this?