superhoops Posted August 28, 2006 Share Posted August 28, 2006 I get this error message:Error: Column count doesn't match value count at row 1The code for the page is: $sql="INSERT INTO Market (id, Player, Price, Type, Position, Age, Ka, Ta, Pa, Sa)VALUES ('','$_POST[Player]','$_POST[Price]','$_POST[Type]''$_POST[Position]','$_POST[Age]','$_POST[GK]','$_POST[DEF]','$_POS[MID]','$_POST[ATT]')"; Does anyone know the problem??? Link to comment Share on other sites More sharing options...
murfitUK Posted August 28, 2006 Share Posted August 28, 2006 You've missed out a comma (,) between:'$_POST[Type]' '$_POST[Position]', Link to comment Share on other sites More sharing options...
Jack McKalling Posted August 28, 2006 Share Posted August 28, 2006 (edited) There are several mistakes.Remember this thing: a variable that is an array and has an element definition, namely angled brackets, then the string would ignore those brackets and read only the variable (array) name, IF you don't surround the entire variable with element specifications by braces Like this:$string = "this is a piece of text with the word {$_POST[Player]} specified";Besides, when those array keys are strings instead of numbers, they must be quoted (single). So this is it:$string = "this is a piece of text with the word {$_POST['Player']} specified";[*Edit:] It doesn't matter if it is SQL or not, thats a string too. Edited August 28, 2006 by Dan The Prof Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now