blink359 Posted July 23, 2010 Share Posted July 23, 2010 I have made a script to put an account into a database but whenever i try to create the account i get:Column count doesn't match value count at row 1 I cannot find a problem myself and therefore i have come to ask you guys if you can see it this is my database structure from an export: CREATE TABLE `users` ( `f_name` varchar(20) collate latin1_general_ci NOT NULL, `l_name` varchar(20) collate latin1_general_ci NOT NULL, `user` varchar(20) collate latin1_general_ci NOT NULL, `password` varchar(20) collate latin1_general_ci NOT NULL, `email` varchar(35) collate latin1_general_ci NOT NULL, PRIMARY KEY (`user`) Here is my mysql query in the php script mysql_query("INSERT INTO users (`f_name`, `l_name`, `user`,`password`,`email`) VALUES('$firstname', '$lasttname', '$username', '$password' '$email')") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/208658-column-count-doesnt-match-value-count-at-row-1/ Share on other sites More sharing options...
freelance84 Posted July 23, 2010 Share Posted July 23, 2010 $query_insert = mysql_query("INSERT INTO users (f_name, l_name, user,password,email) VALUES('$firstname', '$lastname', '$username', '$password', '$email')"); if(!$query_insert) mysql_error(); If the table exists with those titles this should work (you don't need the back ticks and the variable $lastname was $lasttname and there was a comma missing between email and password) Link to comment https://forums.phpfreaks.com/topic/208658-column-count-doesnt-match-value-count-at-row-1/#findComment-1090093 Share on other sites More sharing options...
blink359 Posted July 23, 2010 Author Share Posted July 23, 2010 Thank you Link to comment https://forums.phpfreaks.com/topic/208658-column-count-doesnt-match-value-count-at-row-1/#findComment-1090096 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.