RE: MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux