IF it is a null in that column, you should not see the word 'null'..
and the advise to put quotes around it I read earlier in this thread
is completely misguided..   If you insert the string 'null' or 'NULL'
into the database, you have just strored a string..

Perhaps it is the form of your queries: NULL needs special handling.
YOu cant say
SELECT * FROM foo WHERE bar = null;

you need to specify:
SELECT * FROM foo WHERE bar IS NULL;

Nothing ever 'equals' NULL in SQL not even another NULL..

 - michael


On 8/9/07, Mahmoud Badreddine <[EMAIL PROTECTED]> wrote:
> I did remove that column from the insert statement and no text appeared at
> all in that field under that column. Not even the word "NULL".
>
> On 8/8/07, Christian High <[EMAIL PROTECTED]> wrote:
> >
> > On 8/8/07, Brent Baisley <[EMAIL PROTECTED]> wrote:
> > > One thing to check is to make sure you are not quoting your NULL
> > > value for your insert statement. MySQL will try to convert that to a
> > > numeric value, which may end up as 0.
> > >
> > > On Aug 8, 2007, at 12:55 PM, Mahmoud Badreddine wrote:
> > >
> > > > Hello
> > > > I have a table which contain a few numerical values.
> > > > I set the default values to be NULL.
> > > > When I insert values using phpMyAdmin, it sets the values to NULL
> > > > correctly.
> > > > But when I insert using a PHP script that I wrote it sets the values
> > > > to 0.00or 0.
> > > > In my script I do test if the values are empty and in case they are
> > > > I set
> > > > the variable to NULL. But that still doesn't help.
> > > > Is that a mysql problem ?
> > > > Thank you.
> > > >
> > > > --
> > > > -Mahmoud Badreddine
> > > >
> > > > http://www.spreadfirefox.com/
> > >
> > >
> > > --
> > > MySQL General Mailing List
> > > For list archives: http://lists.mysql.com/mysql
> > > To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> > >
> > >
> > As long as you are testing to see if they should be null, and the
> > default is set to null, you could exclude the column all together from
> > the insert statement and you should see they are then recorded in the
> > table as null.
> >
> > cj
> >
>
>
>
> --
> -Mahmoud Badreddine
>
> http://www.spreadfirefox.com/
>


-- 
 - michael dykman
 - [EMAIL PROTECTED]

 - All models are wrong.  Some models are useful.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to