php mysqli insert not working
I have a form that is made from multiple pages. those pages are included
through php include. I had a problem with this form previously but that
one is solved. This problem can be seen here mysqli php post insert into
database
Now i added to this form all the products that needed to be added and this
gives the following insert.php page.
// Get all post values
// HOOFDPRODUCT
$PC10001 = $_POST['PC10001'];
$PC10005 = $_POST['PC10005'];
$PC10009 = $_POST['PC10009'];
// Insert post values to table
mysqli_query($con,"INSERT INTO cypg8_overzicht (PC10001,PC10005,PC10009)
VALUES ('".$PC10001.",".$PC10005.",".$PC10009."')");
But it does not work. I dont get errors it processes the insert.php page
but the values are not inserted into the db.
The form consists almost entirely out of checkboxes and they are all setup
like this:
<input type="checkbox" onclick="this.form.checkbox35.checked =
this.checked;" class="onoffswitch-checkbox" id="myonoffswitch35"
name="PC12113" value="checked">
The db table is setup like this:
CREATE TABLE IF NOT EXISTS `cypg8_overzicht` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`PC10001` varchar(7) NOT NULL,
`PC10005` varchar(7) NOT NULL,
`PC10009` varchar(7) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
I hope i gave enough information.
The Question Why are the values not saved to DB?
EDIT 1 ERROR CODE
Warning: mysqli_error() expects exactly 1 parameter, 0 given in line 163
No comments:
Post a Comment