prcollin Posted July 24, 2008 Share Posted July 24, 2008 What does this error mean Error: Column count doesn't match value count at row 1 Link to comment https://forums.phpfreaks.com/topic/116460-solved-error-column-count-doesnt-match-value-count-at-row-1/ Share on other sites More sharing options...
revraz Posted July 24, 2008 Share Posted July 24, 2008 Means the number of fields you are trying to Insert doesn't match the number of fields in the Database. Link to comment https://forums.phpfreaks.com/topic/116460-solved-error-column-count-doesnt-match-value-count-at-row-1/#findComment-598858 Share on other sites More sharing options...
paul2463 Posted July 24, 2008 Share Posted July 24, 2008 it normally means that you are either trying to insert not enough information into the table or too much information. lets say you have a tabvle with 4 columns called tester $query = "INSERT INTO tester VALUES ("a", "b", "c", "d", "e")"; would throw an error becasue there are only 4 columns and you are tyring to insert 5 items Link to comment https://forums.phpfreaks.com/topic/116460-solved-error-column-count-doesnt-match-value-count-at-row-1/#findComment-598860 Share on other sites More sharing options...
prcollin Posted July 24, 2008 Author Share Posted July 24, 2008 How does this code look would you change anything? <?php include "clientconnect.php"; include "newclient.html"; mysql_select_db('greencut_customercenter', $con); $client_id = mysql_real_escape_string($_POST['client_id']); $client_fname = mysql_real_escape_string($_POST['client_fname']); $client_lname = mysql_real_escape_string($_POST['client_lname']); $client_address = mysql_real_escape_string($_POST['client_address']); $client_city = mysql_real_escape_string($_POST['client_city']); $client_state = mysql_real_escape_string($_POST['client_state']); $client_zipcode = mysql_real_escape_string($_POST['client_zipcode']); $client_phone = mysql_real_escape_string($_POST['client_phone']); $client_cphone = mysql_real_escape_string($_POST['client_cphone']); $client_email = mysql_real_escape_string($_POST['client_email']); $client_website = mysql_real_escape_string($_POST['client_website']); $client_notes = mysql_real_escape_string($_POST['client_notes']); $sql = "insert into clients values('$client_id', '$client_fname', '$client_lname', '$client_address', '$client_city', '$client_state', '$client_zipcode', '$client_phone', '$client_cphone', '$client_email', '$client_website', '$client_notes',)"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added";mysql_close($con) ?> Link to comment https://forums.phpfreaks.com/topic/116460-solved-error-column-count-doesnt-match-value-count-at-row-1/#findComment-598895 Share on other sites More sharing options...
prcollin Posted July 24, 2008 Author Share Posted July 24, 2008 NM found the error i had an extra comma somwhere that didnt need to be there Link to comment https://forums.phpfreaks.com/topic/116460-solved-error-column-count-doesnt-match-value-count-at-row-1/#findComment-598899 Share on other sites More sharing options...
paul2463 Posted July 24, 2008 Share Posted July 24, 2008 they are a bugger, them itinerant commas, arnt they?? Link to comment https://forums.phpfreaks.com/topic/116460-solved-error-column-count-doesnt-match-value-count-at-row-1/#findComment-598925 Share on other sites More sharing options...
prcollin Posted July 25, 2008 Author Share Posted July 25, 2008 they are a bugger, them itinerant commas, arnt they?? yeah they suck but now i have new issues, i keep getting errors about a deplicat entry for key 2. Cant solve it and its pissing me off, i have tried everything rearranged databse tried code 5 different ways. BLAH Link to comment https://forums.phpfreaks.com/topic/116460-solved-error-column-count-doesnt-match-value-count-at-row-1/#findComment-599644 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.