I don't understand the concept of the fetch function.
I am doing a tutorial from 'PHP Solutions' book and i am using MySQL Improved to update something in the database.
Here is the code:
if (isset($_GET['article']) && !$_POST) {
$sql = 'SELECT article_id, title, article
FROM journal WHERE article_id = ?';
$stmt = $conn->stmt_init();
if ($stmt->prepare($sql)) {
$stmt->bind_param('i', $_GET['article_id']);
$stmt->bind_result($article_id, $title, $article);
//execute the query, and fetch the result
$OK = $stmt->execute();
$stmt->fetch();
}
}
So what is the fetch actually doing? I thought the execute() function is sending the information to the database and then it returns a true/false value to the $OK variable.
Is fetch() storing something in $stmt? Anybody have any idea what it is doing?