RE: sqlite AND OR query ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



chris@xxxxxxxxxxxx wrote:
> 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.


SELECT * FROM domains WHERE (date = '0000-00-00' OR date = '$today')

-B

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux