drazvzi741287 2015-05-26 22:40
浏览 22

它不会回显数据库中的列

When I am trying to choose t1 column 1 and t2 column 2 from database, it won't echo it out, can anyone tell me if this line is wrong?

$query_category = "SELECT recipedia_categories.category_name, recipedia_recipies.category 
FROM recipedia_categories 
INNER JOIN category 
ON recipedia_categories.ID=recipedia_recipies.category_ID";
$result_category = $db->query($query_category);
while ($row_category = $result_category->fetch_assoc()) {
    $cat_name = $row_category['category_name'];
}

and in HTML I am using

<?=$cat_name;?>

When using the fetch_assoc it gives me an error

Fatal error: Call to a member function fetch_assoc() on boolean

I hope someone can tell me what's wrong here :)

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 Revit2020下载问题
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
    • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
    • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 如何在炒股软件中,爬到我想看的日k线