Actually that's my bad. That's what I get for doing a hundred other things while I'm reading my email. Sorry. I really don't know why null would be different under PHP and mysql; I'm not even sure it is. Right now I'm reloading my server due to a lighting hit (REALLY REALLY bad storms), so I really can't even play with it. However I was thinking (and this would be trying not knowing) that maybe you could change: if ($comment==""): $comment=null; endif;
to if ($comment==""): $comment='null'; endif; Granted it is text whether then a null variable, but it would give you a possible fix. Of course it goes without saying that you would have to change your script below when it checks for a null value to check for the text 'null'. At least this way you it would be like you typed it in...of course this may not be the best way. Sorry about the misunderstanding...like I said my bad. David -----Original Message----- From: Jonas Thorell [mailto:[EMAIL PROTECTED] Sent: Sunday, July 27, 2003 10:10 AM To: 'David Smith'; [EMAIL PROTECTED] Subject: RE: [PHP] PHP, MySQL and null? Sorry, wrote wrong here so one more try. Well, no. But that's not where the problem is. If I was unclear - the id-field work as it should. It's when I try to use A variable in the query-string the problem pops up. IOW - INSERT INTO SITE (id,name,url,comment) VALUES (null,'testname','testurl',null) Works INSERT INTO SITE (id,name,url,comment) VALUES (null,'$name','$url','$comment') Does not when I've set $comment=null; If every field has a proper value (when everything had been filled in on the form), Everything works as expected. /Jonas --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php