Can anyone assist me. I keep getting and error stating that the Column count doesnt match row 1. I have counted all of my fields and referenced all of them but still no dice.

$con=mysql_connect($host, $username, $pass);
if(!$con)
{
    die("Could Not Connect: ".mysql_error());
}
mysql_select_db($db);


$CustLName=$_POST['CustLName'];
$CustFName=$_POST['CustFName'];
$CBR=$_POST['CBR'];
$AcctNum=$_POST['AcctNum'];
$CustCode=$_POST['CustCode'];
$SourceTN=$_POST['SourceTN'];
$SSID=$_POST['SSID'];
$AcctType=$_POST['AcctType'];
$AuthSys=$_POST['AuthSys'];
$CSRSentID=$_POST['CSRSentID'];
$EscSentID='ap608u';
$Issue=$_POST['Issue'];
$EscNum=date('U');
$Program=$_POST['Program'];
if(isset($_POST['Submit']))
{
    $addNew=mysql_query("INSERT INTO $mirtable ( ID, EscNum , EscSentID, CSRSentID, CustFName, CustLName, AcctNum, AcctType, CustCode, Issue, STN, AuthSys, SSID, CBR, Program) VALUES('', '$EscNum', '$EscSentID', '$CSRSentID', '$CustFName', '$CustLName', '$AcctNum,' '$AcctType', '$CustCode', '$Issue', '$SourceTN', '$AuthSys', '$SSID', '$CBR', '$Program')") or die ("Error in query: .\n\nQuery: $addNew\n\nError: " .mysql_error());
}
Re: I need some Help. Error Column count doesn't match value count at row 1 80 80

When using the insert statement, there is no need to include the "ID" field. Since your database has auto encriment, it will add it for you automatically. So take out the "ID" in the INSERT statement and '' in the VALUES.

Re: I need some Help. Error Column count doesn't match value count at row 1 80 80

maybe u have to remove the ' in VALUES parenthesis

Re: I need some Help. Error Column count doesn't match value count at row 1 80 80

I ran into the same error.
What I did was break the SQL statement up and not save it all in one go. Use the INSERT to place the first name, last name, CBR, and account numbers. Then use UPDATE to fill in the remaining information.

FYI - You don't need to transfer your POST variables into different variables to save them into a database, you can save the directly to your database and elimate that step. Move the '' to the front and end of the variable
Example: '$_POST[CustLName]' *INSTEAD OF* $_POST['CustLName']

Re: I need some Help. Error Column count doesn't match value count at row 1 80 80

The problem is that the comat after

'$AcctNum,'

is not out. So MySQL engine thing that you want to store less than the column you define. Set it like this

'$AcctNum',

Hope this helpful for other developers. Excuse my english, my language is french

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.