Jump to content

Errors


superhoops

Recommended Posts

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

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 by Dan The Prof
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...