8be6b61b-44ea-4011-bec7-0414db0b22fc
prompter
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
2fec74ef-a820-4f1c-b02c-4930eac58590
8be6b61b-44ea-4011-bec7-0414db0b22fc
assistant
This error means that your SQL statement has ? parameters (placeholders for bound variables), but you didn't actually bind that many variables to the statement.
For example, if your SQL was:
SELECT * FROM users WHERE id = ? AND name = ?

Then you'd need to bind two variables to the statement - likely with a call like:
stmt.bind_param('ii', $id, $name)

But if you only bound one variable, you'd get this HY093 error since the number of bound variables (1) doesn't match the number of tokens (2) in the SQL.
So you just need to ensure you bind the correct number of variables to match the number of placeholders in your SQL statement.
f32b33f7-0da4-4427-a06a-f9456ee05a29
2fec74ef-a820-4f1c-b02c-4930eac58590
prompter
How do determine how many placeholders I have?
a52e80a9-f656-4461-9420-a65b5b2b862f
f32b33f7-0da4-4427-a06a-f9456ee05a29
assistant
The number of placeholders in an SQL statement can be determined by counting the number of ? parameters in it. For example, in my previous example there are two parameters which are ? parameters: "id = ?" and "name = ?".
By changing one parameter to a fix value it would have only one placeholder. For example:
SELECT * FROM users WHERE id = ? AND name = "John Doe"

As you can see, in this modified SQL statement the "name" parameter was changed to "John Doe" from a placeholder, so now only the "id" parameter is a placeholder.