Hi Jeff,

Try the magic undef as it is with no '' or ""

$dbh->do('insert into yourtab values (' .
      join (',', map($dbh->quote($_), $your_stuff, undef, $more_stuff)) .
         ')') ;


Regards
Salam


Jeff Snoxell wrote:
Hello,

I've got a mysql table with a lot of fields and I'm using a map statement to pass each of my values for a new record through the quote system so-as to have everything nicely wrapped up. Problem is that I can't find any way of writing a null value to my DB when the value has first passed through quote().

I've tried:

my $err = $MyDatabase->do('INSERT INTO MyTable VALUES(' .
join(",",map($MyDatabase->quote($_),
0, # REF
0, # PARENT REF
$FormData{'Title'} . " " . $FormData{'Name'} . "",
$FormData{'Email'} . "",
"\N", # <-- I REALLY WANT THIS TO BE A NULL VALUE!
etc.,
etc.,
etc.....
)) .
')');

Which works fine except the "\N" isn't entered into my database as a null value. I've also tried '\N' and '' and "".

Any ideas how I can solve this easily?

Thanks,


Jeff

---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to