That method gets rid of your use of prepared statements. I would recommend you stick with prepared statements.
There are lots of examples on the PHP documentation pages:
http://www.php.net/m....get-result.phpLook at Example #1. Also, reference the class synopsis to learn how to use its methods. In your case, all you have to do is call the "get_result()" method on your statement object:
mysqli_stmt
{
...
/* Methods */
...
mysqli_result get_result ( void )
...
}
Like this:
if ($stmt = $this->mysqli->prepare('SELECT * FROM `table` WHERE id=? LIMIT 1'))
{
$stmt->bind_param("i",$this->ID);
$stmt->execute();
// This line is what you were missing.
$result = $stmt->get_result();
// fetching all to object or associative array
while ($data = $result->fetch_assoc())
{
...
}
$result->close();
}
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
– Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid