I wonder if the new system [ mysqli_prepare() & bind_param() ] has not removed part of the flexibility we use to have when coding. For trying to upgrade a full well working website to this new level (rewriting all the classes), I'm just facing some limits. How would the following code now be handled within bind_param() & mysqli_prepare() ?
Code:
$array= array(1,2,3); // this array is unlimited
$sql=" SELECT price FROM ".self::$table." WHERE name='X' ";
foreach($array as $num):
$sql .=" OR position='".$num."' ";
endforeach;
$sql .= "group by price";
How now inside ?
$stmt= mysqli_prepare($this->connection,$sql); // ???
$stmt->bind_param(); // ???