I have a number box <input type='number' step='any' name='number' id='number'>
and I take that value and call it in a function like so:
insertIntoDB($number)
function insertIntoDB($number = null){
//insert into db
"INSERT INTO 'tablename' (number) VALUES " . $number;
}
and I get this error:
Error: 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 ' '
Is there away so if the user leaves the field blank it will enter the value as null?