Jump to content

how to test for null


guyfromfl

Recommended Posts

im working on my band's website, and some shows we have a flyer some we dont

 

i want to cycle the shows we do have flyers/pictures for randomly.

 

 

this is the SQL im using right now but wont work.

 

SELECT showId, showPicture
FROM shows
WHERE showDate >= curdate()
AND showPicture IS NOT NULL
ORDER BY rand()

 

where by default showPicture is set as null (so i could use that test to see if there was a flyer associated with that show)

 

when i type that query directly into my MySQL cmd line it returns all the results that are comming up (by date) with and with out pictures...

 

all i need are the ones that are comming up AND have a picture to display.

 

 

Link to comment
https://forums.phpfreaks.com/topic/118890-how-to-test-for-null/
Share on other sites

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.