Re: PHP and PostgreSQL
| From: | Michael Teter | Date: | Tue, 04 Jul 2000 19:20:07 +0000 |
| Subject: | Re: PHP and PostgreSQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-4803@lists.php.net to get a copy of this message | ||
It should work.
But as a workaround, you could do something like this:
"select * from someTable where trim(review) = '' or
review = NULL"
That would give you the rows where review is basically
blank or NULL.
My SQL syntax my not be exactly right... double check
it for your system. But the idea should work. I've
done it before in different DBMSs.
michael
--- Corey Mosher <corey@hub.org> wrote:
> Michael,
>
> This does not work for me, I have tried it already.
>
> Corey
>
> On Tue, 4 Jul 2000, Michael Teter wrote:
>
> > "insert into someTable (someColumn) values (NULL)"
> >
> > or
> >
> > $someVar = "NULL"
> > "insert into someTable(someColumn) values
> ($someVar)"
> >
> > or if you're not sure if someVar will have a real
> > value or instead a null value, do this:
> >
> > ...test $someVar... is it null or all space?
> > yes: $someVar = "NULL"
> > no: $someVar = "'" . $someVar . "'"
> >
> > then do this again:
> > "insert into someTable(someColumn) values
> ($someVar)"
> >
> > michael
> >
> > --- Corey Mosher <corey@hub.org> wrote:
> > > Hi,
> > > I am trying to do an insert into my
> postgreSQL
> > > database
> > > from a form. When I try to insert a null value,
> it
> > > gets
> > > put into the database as a string of spaces.
> Any
> > > ideas as to
> > > why and how to insert the correct null value?
> > >
> > > Corey Mosher
> > > Hub.Org Networking Services
> > > Wolfville, NS
> > > Canada
> > > corey@hub.org
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail:
> > > php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail:
> > > php-general-help@lists.php.net
> > > To contact the list administrators, e-mail:
> > > php-list-admin@lists.php.net
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Kick off your party with Yahoo! Invites.
> > http://invites.yahoo.com/
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail:
> php-general-help@lists.php.net
> > To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
> >
>
> Corey Mosher
> Hub.Org Networking Services
> Wolfville, NS
> Canada
> corey@hub.org
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/