postgres timestame php

Hello All-

I need to extract a result from a postgres database and PHP.
I need to get everything greater than today's date.
I'm comparing it against a timestamp field that can have something like
'2006-12-30 05:47:35.089-05' or NULL.
Basically:
SELECT * from table_name
WHERE timestamp_field is >= today

I want the NULL values in the result set as well...

Thanks in advance

ZMAN
ZMan [ Do, 11 Januar 2007 20:55 ] [ ID #1592485 ]

Re: postgres timestame php

ZMAN wrote:
> Hello All-
>
> I need to extract a result from a postgres database and PHP.
> I need to get everything greater than today's date.
> I'm comparing it against a timestamp field that can have something
> like '2006-12-30 05:47:35.089-05' or NULL.
> Basically:
> SELECT * from table_name
> WHERE timestamp_field is >= today
>
> I want the NULL values in the result set as well...
>

Euhm, not sure about postgres, in MySQL this works:
WHERE timestamp_field >= NOW() OR timestamp_field IS NULL
--
Rik Wasmus
Rik [ Fr, 12 Januar 2007 09:59 ] [ ID #1593635 ]

Re: postgres timestame php

Post removed (X-No-Archive: yes)
Notifier Deamon [ Sa, 13 Januar 2007 01:56 ] [ ID #1594369 ]

Re: postgres timestame php

"Rik" <luiheidsgoeroe [at] hotmail.com> wrote in message
news:2f214$45a74d46$8259c69c$7798 [at] news2.tudelft.nl...
> ZMAN wrote:
>> Hello All-
>>
>> I need to extract a result from a postgres database and PHP.
>> I need to get everything greater than today's date.
>> I'm comparing it against a timestamp field that can have something
>> like '2006-12-30 05:47:35.089-05' or NULL.
>> Basically:
>> SELECT * from table_name
>> WHERE timestamp_field is >= today
>>
>> I want the NULL values in the result set as well...
>>
>
> Euhm, not sure about postgres, in MySQL this works:
> WHERE timestamp_field >= NOW() OR timestamp_field IS NULL
> --
> Rik Wasmus
>
>

Thank you for your response. Stupid me, its "IS" NULL I was doing =
NULL.
It works great thanks very much!!
ZMan [ So, 14 Januar 2007 01:05 ] [ ID #1594993 ]
PHP » alt.php.sql » postgres timestame php

Vorheriges Thema: php not parsing
Nächstes Thema: sessions and persistence?