Can anybody figure out why my dynamically created prepared statement doesn't work. I keep getting the message
Warning: Wrong parameter count for mysqli_stmt::bind_param() in C:\xampp\htdocs\systemTests\dynamicsql2.php on line 53
I dynamically create the $sqlString and the $boundArray and the examples used below are what it returns. Can anybody figure out what I'm doing wrong?
<?php
$sqlString= "SELECT firstName, surname FROM usersDetails WHERE age = ? AND formClass = ?";
$boundArray = Array ( [0] => ss [1] => 22 [2] => testClass );
$stmt = mysqli_prepare($conn, $sqlString);
$stmt->bind_param($boundArray);
$stmt->execute();
?>