I have a sql query and a mysqli prepared statement:
$sql = \'SELECT photographers.photographer_id, photographers.photographer_name
FROM photographers\';
A simple one that actually surprisingly works. I know it's procedural, but still:
$query = "SELECT * FROM foo WHERE bar = ?;";
$stmt = mysqli_prepare($dbc, $query);
mysqli_stmt_bind_param($stmt, "s", $bar);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
return mysqli_fetch_assoc($result);