MYSQL Insert Into - Error
Posted: Sat Aug 15, 2009 10:48 pm
I'm trying to use this insert code, but get an error saying "unknown column" error for anytime there is no value. For example, $service2 will sometimes be empty. Is there a way around this?
Thx in advance!
Thx in advance!
Code: Select all
$sql="INSERT INTO bookings SET
contact = '$contact',
address = '$address',
phone = '$phone',
city = '$city',
date = '$date',
start_time = '$start_time',
end_time = '$end_time',
info = '$info',
main_service = '$main_service',
service1 = '$service1',
service2 = '$service2',
service3 = '$service3',
service4 = '$service4',
email = '$email',
region = '$region',
refer = '$refer',
total = '$grand_total'
";