Select * for mysql prepare statement not listing anything

你离开我真会死。 提交于 2020-01-25 02:19:22

问题


I'm trying to convert a part of code into prepare statements and can't make work the select statement.

It doesn't throw an error, it just don't list the items. Instead of displaying the results it says there are no entries (double check and there are in db).

Any help is much appreciated.

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);

}

来源:https://stackoverflow.com/questions/18399332/select-for-mysql-prepare-statement-not-listing-anything

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!