mrbean Posted April 27, 2011 Share Posted April 27, 2011 error: error sorryColumn count doesn't match value count at row 1 script: <?php mysql_query("INSERT INTO `[logs]` (reffer,ip,locatie,gebeurtenis,kenmerk) VALUES ('".$_SERVER['SCRIPT_NAME']."', '".$_SERVER['REMOTE_ADDR']."', 'registreren van account', 'gebruikersnaam = ".htmlentities($_POST['gebruikersnaam'])."')") or die("error sorry".mysql_error()); ?> whats the problem and how to fix? Link to comment https://forums.phpfreaks.com/topic/234872-column-count-doesnt-match-value-count-at-row-1/ Share on other sites More sharing options...
drisate Posted April 27, 2011 Share Posted April 27, 2011 Your missing the kenmerk value Link to comment https://forums.phpfreaks.com/topic/234872-column-count-doesnt-match-value-count-at-row-1/#findComment-1206951 Share on other sites More sharing options...
fugix Posted April 27, 2011 Share Posted April 27, 2011 this error means that the number of columns in your db does not match the number of columns that you are trying to insert into..it looks like in your code that you have 5 columns and you are only adding data into 4 of them..you need blank quotes ('') for any column that you do not wish to add data into Link to comment https://forums.phpfreaks.com/topic/234872-column-count-doesnt-match-value-count-at-row-1/#findComment-1206952 Share on other sites More sharing options...
Maq Posted April 27, 2011 Share Posted April 27, 2011 I think the problem is that you specify 5 columns and only give 4 values. Link to comment https://forums.phpfreaks.com/topic/234872-column-count-doesnt-match-value-count-at-row-1/#findComment-1206953 Share on other sites More sharing options...
Pikachu2000 Posted April 27, 2011 Share Posted April 27, 2011 You've named 5 fields and only provide 4 values. Look at the query formatted differently, and you should be able to see the problem. mysql_query("INSERT INTO `[logs]` ( reffer, ip, locatie, gebeurtenis, kenmerk ) VALUES ( '".$_SERVER['SCRIPT_NAME']."', '".$_SERVER['REMOTE_ADDR']."', 'registreren van account', 'gebruikersnaam = ".htmlentities($_POST['gebruikersnaam'])."' )") or die("error sorry".mysql_error()); Link to comment https://forums.phpfreaks.com/topic/234872-column-count-doesnt-match-value-count-at-row-1/#findComment-1206954 Share on other sites More sharing options...
mrbean Posted April 27, 2011 Author Share Posted April 27, 2011 again an stupid fault of me. where to buy nerdy glasses Link to comment https://forums.phpfreaks.com/topic/234872-column-count-doesnt-match-value-count-at-row-1/#findComment-1206959 Share on other sites More sharing options...
fugix Posted April 27, 2011 Share Posted April 27, 2011 ebay maybe? ...lol..jk Link to comment https://forums.phpfreaks.com/topic/234872-column-count-doesnt-match-value-count-at-row-1/#findComment-1206963 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.