I'd like to use parameterized queries but it seems tricky. When I installed it on windows i could use mysqli::get_results.
Code:
<?php
$mysqli = new mysqli("localhost", "username", "password", "database");
function run_sql($sql,$parameters=null)
{global $mysqli,$mysqli_results;
$stmt = $mysqli->prepare($sql);
if($parameters!=null)
{call_user_func_array(array($stmt,'bind_param'),$parameters);
}
$stmt->execute();
$mysqli_results=$stmt->get_result();
}
function fetch_array()
{global $mysqli_results;
return mysqli_fetch_array($mysqli_results);
}
?>
When I try the above functions I get "Call to undefined method mysqli_stmt::get_result"
Are there other less mysql specific functions I can use to use parameterized sql statements?