P粉5133162212023-08-23 14:52:19
Your prepared statement is wrong, it should be:
$stmt = $mysqli->prepare(" SELECT DISTINCT model FROM vehicle_types WHERE year = ? AND make = ? ORDER by model "); $stmt->bind_param('is', $year, $make); $stmt->execute();
When you prepare a statement, you must replace each variable with a question mark instead of quotes. Question marks within quotes will not be recognized as placeholders.
The number of question marks must be equal to the number of variables in bind_param()