Medyman
07-16-2007, 06:26 PM
Hey guys...
I've been getting a "Column count doesn't match value count at row 1" error.
I'm not sure why it's happening.
The php is below:
<?php
if(isset($_POST['add']))
{
include 'config.php';
include 'opendb.php';
$name = $_POST['name'];
$company = $_POST['company'];
$street = $_POST['street'];
$apt = $_POST['apt'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$phone = $_POST['phone'];
$ext = $_POST['ext'];
$email = $_POST['email'];
$type = $_POST['type'];
$template = $_POST['template'];
$web1 = $_POST['web1'];
$web2 = $_POST['web2'];
$web3 = $_POST['web3'];
$web4 = $_POST['web4'];
$web5 = $_POST['web5'];
$cms = $_POST['cms'];
$sother = $_POST['sother'];
$othertext = $_POST['othertext'];
$programming = $_POST['programming'];
$domain = $_POST['domain'];
$hosting = $_POST['hosting'];
$management = $_POST['management'];
$seo = $_POST['seo'];
$ses = $_POST['ses'];
$marketing = $_POST['marketing'];
$budget = $_POST['budget'];
$date = $_POST['date'];
$month = $_POST['month'];
$year = $_POST['year'];
$query = "INSERT INTO custom (id, name, company, street, apt, city, state, zip, phone, ext, email, type, template, web1, web2, web3, web4, web5, cms, sother, othertext, programming, domain, hosting, management, seo, ses, marketing, budget, date, month, year)
VALUES ('','${name}','${company}','${street}','${city}','${state}','${zip}''${phone}','${ext}','${email}','${template}','${web1}','${web2}','${web3}','${web4}','${web5 }','${cms}','${sother}','${othertext}','${programming}','${domain}','${hosting}','${management}','${seo}','${ses}','${marketing}','${budget}','${date}','${month }','${year}')";
mysql_query($query) or die(mysql_error());
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed');
include 'closedb.php';
echo "Values Added";
}
else
{
?>
I've been getting a "Column count doesn't match value count at row 1" error.
I'm not sure why it's happening.
The php is below:
<?php
if(isset($_POST['add']))
{
include 'config.php';
include 'opendb.php';
$name = $_POST['name'];
$company = $_POST['company'];
$street = $_POST['street'];
$apt = $_POST['apt'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$phone = $_POST['phone'];
$ext = $_POST['ext'];
$email = $_POST['email'];
$type = $_POST['type'];
$template = $_POST['template'];
$web1 = $_POST['web1'];
$web2 = $_POST['web2'];
$web3 = $_POST['web3'];
$web4 = $_POST['web4'];
$web5 = $_POST['web5'];
$cms = $_POST['cms'];
$sother = $_POST['sother'];
$othertext = $_POST['othertext'];
$programming = $_POST['programming'];
$domain = $_POST['domain'];
$hosting = $_POST['hosting'];
$management = $_POST['management'];
$seo = $_POST['seo'];
$ses = $_POST['ses'];
$marketing = $_POST['marketing'];
$budget = $_POST['budget'];
$date = $_POST['date'];
$month = $_POST['month'];
$year = $_POST['year'];
$query = "INSERT INTO custom (id, name, company, street, apt, city, state, zip, phone, ext, email, type, template, web1, web2, web3, web4, web5, cms, sother, othertext, programming, domain, hosting, management, seo, ses, marketing, budget, date, month, year)
VALUES ('','${name}','${company}','${street}','${city}','${state}','${zip}''${phone}','${ext}','${email}','${template}','${web1}','${web2}','${web3}','${web4}','${web5 }','${cms}','${sother}','${othertext}','${programming}','${domain}','${hosting}','${management}','${seo}','${ses}','${marketing}','${budget}','${date}','${month }','${year}')";
mysql_query($query) or die(mysql_error());
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed');
include 'closedb.php';
echo "Values Added";
}
else
{
?>