RE: [PHP] MySQL

From: Date: Tue, 09 Nov 2004 16:43:57 +0000
Subject: RE: [PHP] MySQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-201626@lists.php.net to get a copy of this message
> If I do something like: > > $string = null; > > mysql_query("insert ignore into table(field) values($string)"); > > It gives me an error. Pass a string value of 'NULL'. Ie INSERT INTO table (field) VALUES (NULL); Or, in your example: $string = 'NULL'; mysql_query("INSERT INTO table (field) VALUES ($string)"); Much warmth, Murray http://www.planetthoughtful.org Building a thoughtful planet, One quirky comment at a time.

« previous php.general (#201626) next »