[thelist] Setting a MySQL value to NULL using PHP

Hans Zaunere zaunere at yahoo.com
Tue Apr 30 16:59:00 CDT 2002


>
> UPDATE tblFOO
> SET bar = NULL
> WHERE ID LIKE '10%'
>
> but I am not getting the expect results. Any clue as to what might be
> causing my problem? I have probably looked at it too closely now, and
> I am
> suffering from brain-freeze.

That should work - check the column type, and be sure you really know
what to expect.

http://www.mysql.com/doc/manual.php?search_query=NULL&depth=0

This (as in this thread) is exactly why I don't use NULL in MySQL, PHP,
or any essentially typeless language/system.  In C, NULL is a wonderful
and coherent thing - in everything else it is an evil monster waiting
to rip your head off and cause you a lot of pain.  Use simply 0, 1, or
negatives if the situation fits.

Hans Z.
New York PHP
http://nyphp.org



>
> TIA!
> Jay
>
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com



More information about the thelist mailing list