I have (in short) code like this:
...
mysql_query("INSERT INTO table1 (x,y,z) VALUES (".$_POST['a'].",".$_POST['b'].",\"".$_POST['c']."\")");
...
a
is numeric value, b
is numeric but empty in form and c
is string value, which can be empty(there is no problem).
Tthen for MySQL it looks like this:
INSERT INTO table1 (x,y,z) VALUES (2,,"");
Problem is part of values, where is nothing like in b
. Is there any solution to get it work? In database settings, or in PHP. I have big table and it is not possible to check every $_POST
value.
thanks