Inserting NULL Integer Values
| From: | Shaun | Date: | Tue, 18 Oct 2005 16:15:41 +0000 |
| Subject: | Inserting NULL Integer Values | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-224281@lists.php.net to get a copy of this message | ||
Hi,
Up to this point in time I used to construct my insert statements like this
$qid = mysql_query('INSERT INTO MYTABLE (
column1,
column2,
) VALUES (
"'.$value1.'",
"'.$value2.'"
)');
However I understand it is better to remove the quote marks around an insert
if the column type is an integer. This is easy to do, however if the $value
is empty it causes a mysql error. Has anyone encountered this and found a
solution?
Thanks for your advice