mysqli, prepare and fetch_row
| From: | Marten Lehmann | Date: | Wed, 22 Oct 2008 20:36:14 +0000 |
| Subject: | mysqli, prepare and fetch_row | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-282293@lists.php.net to get a copy of this message | ||
Hello,
I have a small piece of code where I'm trying to use mysqli with a prepare-statement. I don't want to bind variables for the fetch, instead I want to use something like
list($question) = $stmt->fetch_row();
And this fetch_row should exist according to the documentation. But while mysqli_query returns a result-handle, mysqli_prepare does not. So where do I get it from?
$stmt = $mysqli->prepare("select question from faq_article where id = ?");
$stmt->bind_param("i", $_REQUEST["id"]);
$result = $stmt->execute();
print_r($result);
returns "1" but not a result-handle.
list($question) = $stmt->fetch_row();
doesn't work also, the error message says, that there is no function fetch_row in a statement handle. Thats correct, but how do I get a result-handle?
Regards
Marten