How to use array for MySQLi->bind_param()?

56 views Asked by At

So, say I have an array of values, set by a user somewhere:

$array = array("test0", "test1", "test2");

From that, I automatically prepare a mysqli statement:

$statement = "SELECT * FROM x_table WHERE x = ? AND y = ? AND z = ?";
$s = "sss";

How, can I bind the parameters?

...
$sql->bind_param($s, $array); // without manually typing $array[0], $array[1].. etc.
...
0

There are 0 answers