热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

MySQLifetch_all的奇怪错误-WeirderrorwithMySQLifetch_all

Thisisprobablygoingtobemarkedasaduplicatebutmyerrorseemstobedifferentfromtheother

This is probably going to be marked as a duplicate but my error seems to be different from the others that I've seen here on stackoverflow.

这可能会被标记为重复,但我的错误似乎与我在stackoverflow上看到的其他错误不同。

the following code is supposed to display the content from the image: code:

以下代码应该显示图像中的内容:代码:

 if($news_result = $db->query("SELECT * FROM `news` ORDER BY `likes` DESC LIMIT 4")) {                      
    if ($news_result->num_rows) {
        $rows = $news_result->fetch_all(MYSQL_ASSOC);
            $row_count = 0;
            foreach($rows as $row) {
                $row_count++;

                $content_echo = '
                    ';

                $separator = '  

'; if ($news_result->num_rows > 1 && $row_count > 0 && $row_count <$news_result->num_rows) { $content_echo .= $separator; } echo $content_echo; } } }

Image:

'.$row['title'].'

'.$row['description'].'

BY: '.$row['creator'].'

READ MORE
'; $separator = '
'; echo $content_echo.$separator; } } ?>

推荐阅读
author-avatar
516837745_d2d52c
这个家伙很懒,什么也没留下!
Tags | 热门标签
RankList | 热门文章
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有