insert null into an integer column using dbi/mysql



Hi,
This must be simple, but I don't know why I can't get this to work.

Lets say I have a variable $foo.
I want to assign $foo a null value, so that when I type :
insert into table values($foo);
I will get a NULL in the column. The column happens to be of type
TINYINT unsigned (and takes nulls).

I tried $foo=''; (2 single quotes without a space) but after a warning
it puts in a 0 not NULL.

Thanks a lot,
Roshan

.



Relevant Pages

  • Re: Initialising Variables
    ... int func; ... int foo; ... printf; ... the file contaiing the definition of func, and the warning would go ...
    (comp.lang.c)
  • Re: Scoping Question
    ... * (setf foo 3) ... Warning: This variable is undefined: ... WARN is an external symbol in the KEYWORD package. ... NIL -- Never declare the variable, ...
    (comp.lang.lisp)
  • Weird gcc behaviour with function pointer types
    ... void g{ ... void (struct foo *); ... blarg.c:6: warning: assignment from incompatible pointer type ... This looks like a bug in gcc to me -- what do people ...
    (comp.lang.python)
  • Re: setq givs a warning i SBCL, Not CLISP
    ... If i do the same on CLISP i get no warning ... If you do by accident (setq x ...) you don't want x to be defined ... foo has a function as its value, ... names of global variables, just as a visual clue, so you might want ...
    (comp.lang.lisp)
  • Re: Unexpected Result while compiling this code
    ... When I tried to compile that here (gcc ... > 4.0.2) it _did_ give me an error with a reference to function foo, ... > at the top of your code cause the code to compile cleanly. ... These are the warning messages i got when i compiled on gcc 3.2.2 ...
    (comp.lang.c)