Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: mysqli free results
02-22-2014, 10:00 PM #1
- Join Date
- Aug 2013
- Thanked 0 Times in 0 Posts
mysqli free results
I am new to mysqli and have seen many examples on the internet, but I am struggling with getting mysqli_free_results to work. All the examples I have seen are based on 1 field in the bind results, but because I have 3, in this case, how do I get mysqli_free-results($results) to work?
// Check for errors
// Create a prepared statement
if($stmt = $mysqli -> prepare ("SELECT id, username, password FROM users WHERE password=?"))
// Bind parameters s - String, b - Boolean, i - Integer etc
$stmt -> bind_param("s", $password);
// Execute it
$stmt -> execute();
// Bind result variables
// Fetch the result of the query
echo $id . ' - ' . $password . ' - ' . $username;
echo "<br />";
// Close statement
$stmt -> close();
// Close connection
$mysqli -> close();
02-22-2014, 10:29 PM #2
- Join Date
- Jan 2011
- Thanked 593 Times in 592 Posts
There is no mysqli_free-results($results). It's mysqli_free_result($result); No 's'.
Evolution - The non-random survival of random variants.
"If you leave hydrogen alone, for long enough, it begins to think about itself."