Say i have a form for a user to fill in with some details, for example:
Name:___________
Age:___________
Location:___________
The user DOES NOT have to fill all the fields in.
A normal query for this would look something like:
Code: Select all
$sql = INSERT INTO user_info(name, age, location) VALUES('$name', '$age', '$location');So if the user left out their age, the query should look something like:
Code: Select all
$sql = INSERT INTO user_info(name, age, location) VALUES('$name', NULL, '$location');Thanks
Mark