Jump to content

Any help with SQL statement would be appreciated


Ansel_Tk1

Recommended Posts

Hi - I am trying to contstruct a statement that does this:

 

SELECT * FROM galleries WHERE gallery_id = %s OR ct_page ='photos' AND gallerypublish = 1 ORDER BY gallerydate DESC

 

What I was trying to do: if no value is plugged in to %s via the URL, then no records are returned. In that case, the OR should return values based on whether the field contains the word 'photos'. Obviously, it don't work. Could someone suggest the proper operation to use here?

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.