Hi there here is my SQL insert statement:
$customeraddress_query = "INSERT INTO `customer_address`
(
`apt_num`,
`street1`,
`street2`
'city',
'state',
'date_stamp'
)
VALUES
(
'$aptNum',
'$street1',
'$street2',
'$city',
'$state',
now()
)";
This is giving me the following error:
INSERT INTO `customer_address` ( `apt_num`, `street1`, `street2` 'city', 'state', 'date_stamp' ) VALUES ( '57', 'Col Street', 'x', 'v', 'x', now() )
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 ”city’, ‘state’, ‘date_stamp’ ) VALUES ‘ at line 6
I’m new to SQL and I was wondering if someone could help me with this. I suspect it’s something to do with the right use of quotes.
But I cant seem to get these right.
You are missing a comma(,) after the
street2andcity.Try this: