选择* for mysql prepare语句不列出任何内容

时间:2013-08-23 09:24:59

标签: mysql prepare

我正在尝试将部分代码转换为prepare语句,并且无法使select语句生效。

它不会抛出错误,它只是不列出项目。它没有显示结果,而是没有条目(仔细检查,数据库中有)。

非常感谢任何帮助。

if($_GET[action]=='view-rss')
{
    $count =0;
    $stmt = $GLOBALS["___mysqli_ston"]->prepare("select * from rss where lang=(?)");
    $stmt->bind_param('s', $_SESSION[session_lang]);
    $stmt->execute();
    $stmt->close();

    while($stmt=mysqli_fetch_assoc($query))
    {
        $rss_ids[] = $row['id'];
        $rss_urls[] = $row['url'];
        $rss_titles[] = $row['title'];
        $rss_publishes[] = $row['published'];
        $count= $count +1;
    }
    $smarty->assign("rss_ids", $rss_ids);
    $smarty->assign("rss_urls", $rss_urls);
    $smarty->assign("rss_titles", $rss_titles);
    $smarty->assign("rss_publishes", $rss_publishes);
    $smarty->assign("count", $count);

}

0 个答案:

没有答案