I created a new db/table, ec. for this page data to submit and it gives me this error whenever I try to submit the form.
Bad query or error: Column count doesn't match value count at row 1
Code: Select all
<?php
// Begin submit form variables
$surveyname = $_POST['surveyname'];
$surveyphone = $_POST['surveyphone'];
$surveyemail = $_POST['surveyemail'];
$numcalled = $_POST['numcalled'];
$timecalled = $_POST['timecalled'];
$phoneresolution = $_POST['phoneresolution'];
$helpful = $_POST['helpful'];
$resolution = $_POST['resolution'];
// End submit form variables
// Connect to DB
$link = mysql_connect('localhost','blah','blah') or die ('Could not connect to mySQL: ' .mysql_error() );
// Select Quick Incident DB
$db_selected = mysql_select_db('customer survey', $link) or die ('Could not select DB: ' .mysql_error() );
// Insert form data into DB
mysql_query("INSERT INTO survey (id, surveyname, surveyphone, surveyemail, numcalled, timecalled, phoneresolution, helpful, resolution, submitdate)
VALUES('', '$surveyname', '$surveyphone', '$surveyemail', '$numcalled', '$timecalled', '$phoneresolution', '$helpful', '$resolution', NOW() )")
or die("Bad query or error: ".mysql_error());
mysql_close();
// End insert form data
?>