Forum Moderators: open
i am completley new to php and mysql and am having varied amounts of success, the problem i have at the moment is that inserting to my table, i get "Column count doesn't match value count at row 1"
i have googled this finding that all the sites say i dont have enough fields in my statement, when reading it myself it seems to have enough am i just missing the point here i have included the statement that i believe is causing me the problem below.
all help greatfully recieved.
$query = "INSERT INTO user (user_id, user_name, first_name, surname, password, email, mobile, auth_lvl)
VALUES('$null', '$UserName', '$FirstName', '$SurName', '$Password', '$EmailAddr', '$ContactNum' '$authlevel')" ;
mysql_query($query)
or die(mysql_error());
So IF user_id is an auto-increment field your SQL statement should probably look like:
INSERT INTO user (user_name, first_name, surname, password, email, mobile, auth_lvl)
VALUES('$UserName', '$FirstName', '$SurName', '$Password', '$EmailAddr', '$ContactNum' '$authlevel')