sqlite AND OR query ?

From: Date: Wed, 09 May 2007 00:09:11 +0000
Subject: sqlite AND OR query ?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-254607@lists.php.net to get a copy of this message
Hello, I want to select two dates one being todays date and the other being 0000-00-00 which just a date in the database when no proper date has been entered. Ive tried this but it does not work... $today = date('Y-m-d'); $result = sqlite_query($db, "SELECT * FROM domains WHERE date = '0000-00-00' AND '$today'"); I just get items with '0000-00-00' returned or if I reverse it ie... WHERE date = '$today'AND '0000-00-00'"); I just get $today items returned. I also tried using OR instead of AND ie... WHERE date = '0000-00-00' OR '$today'"); But that seems to be returning all items in the db. Thanks.

« previous php.general (#254607) next »