RE: [PHP] PHP, MySQL and null?

From: Date: Sun, 27 Jul 2003 15:05:31 +0000
Subject: RE: [PHP] PHP, MySQL and null?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157081@lists.php.net to get a copy of this message
>Have you tried inserting it without including the id field in the insert statement? I have several tables with auto increments and I never even bother >putting that field in the insert statement. 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','testcomment'); 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

« previous php.general (#157081) next »