Forum Moderators: coopster
INSERT INTO pbs_contacts( 'contact_id', 'mgt_co_id', 'active', 'contact_type_id', 'first_name', 'last_name', 'nick', 'address_1', 'city', 'state', 'zip', 'tel', 'email', 'created', 'changed', 'contact_notes' )VALUES( NULL, '1', 'yes', '1', 'Kyle', 'Axxxx', '', '', '', '', '', '(252) xxx-xxxx', 'kxxxxxx@yahoo.com', '2019-5-31', '2019-6-25', 'Uploaded from WAR sheet' )
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 ''contact_id', 'mgt_co_id', 'active', 'contact_type_id', 'first_name', 'last_name' at line 2 $sql_command =
" INSERT INTO pbs_contacts(
'contact_id',
'mgt_co_id',
'active',
'contact_type_id',
'first_name',
'last_name',
'nick',
'address_1',
'city',
'state',
'zip',
'tel',
'email',
'created',
'changed',
'contact_notes'
)VALUES(
NULL,
'$mgt_co_id',
'yes',
'1',
'$First_Name',
'$Last_Name',
'$Nick',
'$Address',
'$City',
'$State',
'$Zip',
'$Phone',
'$Email',
'$First_contact',
'$last_updated',
'$Notes'
)";
INSERT INTO pbs_contacts( 'contact_id', 'mgt_co_id', 'active', .....
$sql_command = sprintf("INSERT INTO pbs_contacts (contact_id, mgt_co_id, active, first_name,...) VALUES ('%s', '%s', '%s', '%s',...)",
mysql_real_escape_string($mgt_co_id),
'yes',
'1',
mysql_real_escape_string($First_Name),
...);