Inserting data into a table
Posted: Thu May 28, 2009 11:30 am
Will someone please look at this and see if they can show me why two fields are not inserting into my table. I know the information is there because I also send an email out and all the information is present.
This is my insert statement. Everything is inserted except the phone and the date.
Here is the code for the table
This is my insert statement. Everything is inserted except the phone and the date.
Code: Select all
<?php
include ("dbc.php");
mysql_query("INSERT INTO printers_table
(analyst,
crn_id,
contact_name,
phone,
email,
cost_center,
serial_number,
address,
reason,
date
)
VALUES
('$_POST[analyst]',
'$_POST[crn_id]',
'$_POST[contact_name]',
'$_Post[phone]',
'$_POST[email]',
'$_POST[cost_center]',
'$_POST[serial_number]',
'$_POST[address]',
'$_POST[reason]',
'$_POST[date]'
)
")
or
die(mysql_error());
?>
Code: Select all
CREATE TABLE `printers_table` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`analyst` varchar(200) collate latin1_general_ci NOT NULL DEFAULT '',
`crn_id` varchar(200) collate latin1_general_ci NOT NULL DEFAULT '',
`contact_name` varchar(200) collate latin1_general_ci NOT NULL DEFAULT '',
`phone` varchar(200) collate latin1_general_ci NOT NULL DEFAULT '',
`email` varchar(200) collate latin1_general_ci NOT NULL DEFAULT '',
`cost_center` varchar(200) collate latin1_general_ci NOT NULL DEFAULT '',
`serial_number` varchar(200) collate latin1_general_ci NOT NULL DEFAULT '',
`address` varchar(200) collate latin1_general_ci NOT NULL DEFAULT '',
`reason` varchar(200) collate latin1_general_ci NOT NULL DEFAULT '',
`date` varchar(200) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
)