【问题标题】:Warning: count(): Parameter must be an array or an object that implements Countable警告:count():参数必须是数组或实现 Countable 的对象
【发布时间】:2018-12-19 05:33:40
【问题描述】:

我目前收到此错误:

警告:count():参数必须是数组或对象,在 C:\xampp\htdocs\wordpress\wp-includes\theme.php 第 629 行实现 Countable

我不知道如何解决它。

【问题讨论】:

标签: wordpress


【解决方案1】:

phpmyadmin - count(): Parameter must be an array or an object that implements Countable 的副本

从该页面接受的答案如下。

编辑文件/usr/share/phpmyadmin/libraries/sql.lib.php:

sudo nano /usr/share/phpmyadmin/libraries/sql.lib.php

替换:count($analyzed_sql_results['select_expr'] == 1)

与:(count($analyzed_sql_results['select_expr']) == 1)

重启服务器

sudo service apache2 restart

【讨论】:

    【解决方案2】:

    如果您使用的是 WordPress,请确保 the_content 在循环内。那是我的问题。

    <?php
            while ( have_posts() ) : the_post();
                the_content();
            endwhile; // End of the loop.
            ?>
    

    【讨论】:

      【解决方案3】:
      if($result->num_rows){
              $row = $result->fetch_array();
      
      //use this instead of count()
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-09-10
        • 2019-08-15
        • 2020-01-18
        • 2020-01-27
        • 2019-06-20
        • 2020-04-08
        • 2019-10-18
        • 2018-10-19
        相关资源
        最近更新 更多