It was your own code. I have no idea where do you get these variables or what to put there. You are supposed to have these variables already set. Do you?
Well teacher gave me these code and I was supposed to make them work.
well could you tell me how I can fix the error, I just need it to save to database
Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY093]: Invalid parameter number: parameter was not defined’ in E:\Xamp\htdocs\php12\insert.php:12 Stack trace: #0 E:\Xamp\htdocs\php12\insert.php(12): PDOStatement->execute(Array) #1 {main} thrown in E:\Xamp\htdocs\php12\insert.php on line 12
he used
$Column1 = ; //data here
$Column2 = ; //data here
which I changed to
$Namn = ; //data here
$Losenord = ; //data here
thats my code and when Im trying to make an account i get this error
Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY093]: Invalid parameter number: parameter was not defined’ in E:\Xamp\htdocs\php12\insert.php:13 Stack trace: #0 E:\Xamp\htdocs\php12\insert.php(13): PDOStatement->execute(Array) #1 {main} thrown in E:\Xamp\htdocs\php12\insert.php on line 13
OP now seems to be using bindParam as well as passing in an array of values for the named parameters - would that work? And wouldn’t they need to define the parameter names within the array? Surely the name and password should be coming from the form, not being hard-coded?