【发布时间】:2011-03-21 16:50:44
【问题描述】:
嘿,我有一个快速的。有没有办法将变量包含到准备好的查询中?示例:
$sql = "SELECT id, title, author, LEFT(description, 40) AS excerpt,
image_small, image_med, date
FROM posts
ORDER BY id DESC
LIMIT $start, $postsPerPage";
$result = $connect->prepare($sql) or die ('error');
$result->execute();
$result->bind_result($id, $title, $author, $excerpt, $image_small, $image_med, $date);
谢谢!
【问题讨论】:
-
您的问题不完整,我想您想问的是:如何从准备好的查询中检索结果。在您致电
$result->fetch()之前,您的结果变量将为空
标签: php mysqli prepared-statement