php/mysql error
Posted: Mon Jun 09, 2003 3:35 pm
Ok. Trying to add info to a mysql db and getting a simple error that's driving me crazy
Column count doesn't match value count at row 1
Here's the table
===========================================
$query = "CREATE table newsletterSurvey
(
ID SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT,
learn TEXT,
frequency TEXT,
length TEXT,
format TEXT,
click TEXT,
interest TEXT,
content_area TEXT,
topics TEXT,
degree TEXT,
classYear TEXT,
school TEXT,
age TEXT,
occupation TEXT,
comments TEXT,
date DATE,
PRIMARY KEY(ID)
)" or die (mysql_error());
$results = mysql_db_query($dbName, $query, $connection);
===============================================
Here is the INSERT statement
$query = "INSERT INTO newsletterSurvey VALUES ( '0',
'".$learn."',
'".$frequency."',
'".$length."',
'".$format."',
'".$click."',
'".$interest."',
'".$content_area."',
'".$topics."',
'".$degree."',
'".$classYear."',
'".$school."'
'".$age."',
'".$occupation."',
'".$comments."'
'".$date."')";
$result = mysql_query($query, $connection) or die(mysql_error());
Any idea??
Tks.
Column count doesn't match value count at row 1
Here's the table
===========================================
$query = "CREATE table newsletterSurvey
(
ID SMALLINT(4) UNSIGNED NOT NULL AUTO_INCREMENT,
learn TEXT,
frequency TEXT,
length TEXT,
format TEXT,
click TEXT,
interest TEXT,
content_area TEXT,
topics TEXT,
degree TEXT,
classYear TEXT,
school TEXT,
age TEXT,
occupation TEXT,
comments TEXT,
date DATE,
PRIMARY KEY(ID)
)" or die (mysql_error());
$results = mysql_db_query($dbName, $query, $connection);
===============================================
Here is the INSERT statement
$query = "INSERT INTO newsletterSurvey VALUES ( '0',
'".$learn."',
'".$frequency."',
'".$length."',
'".$format."',
'".$click."',
'".$interest."',
'".$content_area."',
'".$topics."',
'".$degree."',
'".$classYear."',
'".$school."'
'".$age."',
'".$occupation."',
'".$comments."'
'".$date."')";
$result = mysql_query($query, $connection) or die(mysql_error());
Any idea??
Tks.