chuddyuk Posted October 4, 2006 Share Posted October 4, 2006 when i submit my data i get this error - "column count does not match value at line 1"i have tried everything and it still doesnt work someone please help me its really winding me up![code]$sql = "INSERT INTO appform (id, q1, q1a, q2, q2a, q2b, q2c, q3, q3a, q4, q5, q6, q7, q8, q9, q10, q11, q12, q13, q14, q15, q16, q17, q18, q19, q20, q21, q22, q23, q24, q25, q26, q27, q28, q29, q30, q31, q32, q32a, q33, q34, q35, q36, q37, q38, q39, q40, q41, q42, q43, q44, q45, q46, q47, q48, q49, q50, q51, q52, q53, q54, q55, q56, q57, q58, q59, q60, q61, q62, q63, q64, q65, q66, q67, q68, q69, q70, q71, q72, q73, q74, q75, q76, q77, q78, q79, q80, q81, q82, q83, q84, q85, q86, q87, q88, q89, q90, q91, q92, q93, q94, q95, q96, q97, q98, q99, q100, q101) VALUES ('id','$q1','$q1a','$q2','$q2a','$q2b','$q2c','$q3','$q3a','$q4','$q5','$q6','$q7','$q8','$q9','$q10','$q11','$q12','$q13','$q14','$q15','$q16','$q17','$q18','$q19','$q20','$q21','$q22','$q23','$q24','$q25','$q26','$q27','$q28','$q29','$q30','$q31','$q32','$q32a','$q33','$q34','$q35','$q36','$q37','$q38','$q39','$q40','$q41','$q42','$q43','$q44','$q45','$q46','$q47','$q48','$q49','$q50','$q51','$q52','$q53','$q54','$q55','$q56','$q57','$q58','$q59','$q60','$q61','$q62','$q63','$q64','$q65','$q66','$q67','$q68','$q69','$q70','$q71','$q72','$q73','$q74','$q75','$q76','$q77','$q78','$q79','$q80','$q81','$q82','$q83','$q84','$q85','$q86','$q87','$q88','$q89','$q90','$q91','$q92','$q92','$q93','$q94','$q95','$q96','$q97','$q98','$q99','$q100','$q101')";$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());echo "<center>Application Sent<center>";[/code] Link to comment https://forums.phpfreaks.com/topic/22967-please-help-insert-error-column-count-does-not-match-value-at-line-1/ Share on other sites More sharing options...
thedarkwinter Posted October 4, 2006 Share Posted October 4, 2006 hiis id an auto_increment field? you can start by dropping that from both sides if so... as you are trying to insert a vairable it supposed to pick up from itself which i imagine doesn't work.secondly - as much as i would love to verify the counts of the q's on both sides!!! lol!cheers,tdw Link to comment https://forums.phpfreaks.com/topic/22967-please-help-insert-error-column-count-does-not-match-value-at-line-1/#findComment-103647 Share on other sites More sharing options...
chuddyuk Posted October 4, 2006 Author Share Posted October 4, 2006 im using [code]srand((double)microtime()*1000000); $id1 = rand(1000,9999);srand((double)microtime()*1000000); $id2 = rand(1000,9999); $id = $id1 . $id2;$id = md5($id);[/code]to make the id. Link to comment https://forums.phpfreaks.com/topic/22967-please-help-insert-error-column-count-does-not-match-value-at-line-1/#findComment-103649 Share on other sites More sharing options...
thedarkwinter Posted October 4, 2006 Share Posted October 4, 2006 ... okay well then in the VALUES part of the query you need to change q100, q101) VALUES ('id','$q1',to q100, q101) VALUES ('$id','$q1',to read the variable.cheers,tdw Link to comment https://forums.phpfreaks.com/topic/22967-please-help-insert-error-column-count-does-not-match-value-at-line-1/#findComment-103687 Share on other sites More sharing options...
mjlogan Posted October 4, 2006 Share Posted October 4, 2006 '$q92','$q92',You have a duplicated entry. So the column counts don't match up. Link to comment https://forums.phpfreaks.com/topic/22967-please-help-insert-error-column-count-does-not-match-value-at-line-1/#findComment-103689 Share on other sites More sharing options...
chuddyuk Posted October 4, 2006 Author Share Posted October 4, 2006 Mjlogan Yours a star, iv been staring at that for hours looking for duplicates or missing one. thank you so much mate! Link to comment https://forums.phpfreaks.com/topic/22967-please-help-insert-error-column-count-does-not-match-value-at-line-1/#findComment-103703 Share on other sites More sharing options...
fenway Posted October 4, 2006 Share Posted October 4, 2006 Yikes... If you're going to have something as ridiculous as that, it had better be dynamically generated. Link to comment https://forums.phpfreaks.com/topic/22967-please-help-insert-error-column-count-does-not-match-value-at-line-1/#findComment-103897 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.