嘿,我有一个快速的。有没有办法将变量包含到准备好的查询中?例如:php mysqli准备好声明
$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()' – knittl 2011-03-21 08:29:50