我正在尝试将变量设置为NULL
:
$q = NULL.",";
$q .= 'abc';
并保存到数据库中:
mysql_query("INSERT INTO table (col_a, col_b) VALUES (".$q.")")
但这会产生错误消息:
INSERT INTO table (col_a, col_b) VALUES (,'abc')You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ','abc')' at line 2
如何NULL
从变量保存到数据库中?