, localhost ( ).
:
1. store_result() execute(). http://php.net/manual/en/mysqli-stmt.store-result.php execute() .
, :
unset($stmt);
$stmt = $db->stmt_init();
$stmt = $db->prepare("SELECT * FROM logs ORDER BY `id` DESC");
if (!$stmt->execute()) {
echo "query execution error";
exit();
}
$stmt->store_result();
$stmt->bind_result($r_id, $r_time, $r_logger, $r_message, $r_category);
while($stmt->fetch()) {
var_dump($r_message);
var_dump($r_category);
}
$stmt->close();
, .
, , , WHERE first_name LIKE <input here>:
$result = $db->query("SELECT * FROM logs ORDER BY `id` DESC");
if ($result === false) {
echo "query execution error";
exit();
}
echo "<pre>";
while($line = $result->fetch_array(MYSQLI_NUM)) {
print_r($line);
echo "\n";
}
echo "</pre>";