【问题标题】:error in phpMyAdminphpMyAdmin 中的错误
【发布时间】:2017-09-28 09:11:56
【问题描述】:

我正在创建具有两列(id、name)的数据库(产品)表项目,我向这些列添加了值,然后显示此错误

Warning in .\libraries\DisplayResults.php#869
 A non-numeric value encountered

Backtrace

.\libraries\DisplayResults.php#4933: PMA\libraries\DisplayResults->_getTableNavigation(
integer 0,
integer 0,
boolean false,
string '',
)
.\libraries\DisplayResults.php#4378: PMA\libraries\DisplayResults->_getPlacedTableNavigations(
integer 0,
integer 0,
string 'top_direction_dropdown',
boolean false,
string '',
)
.\libraries\sql.lib.php#1685: PMA\libraries\DisplayResults->getTable(
,
array,
array,
boolean false,
)
.\libraries\sql.lib.php#1976: PMA_getHtmlForSqlQueryResultsTable(
,
string './themes/pmahomme/img/',
NULL,
array,
boolean true,
integer 1,
integer 1,
NULL,
,
array,
)
.\libraries\sql.lib.php#2199: PMA_getQueryResponseForResultsReturned(
,
array,
string 'products',
string 'items',
NULL,
NULL,
,
string './themes/pmahomme/img/',
integer 1,
integer 1,
NULL,
NULL,
NULL,
NULL,
NULL,
string 'SELECT * FROM `items`',
NULL,
)
.\libraries\sql.lib.php#2061: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'products',
string 'items',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `items`',
NULL,
NULL,
)
.\sql.php#221: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'products',
string 'items',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `items`',
NULL,
NULL,
)

【问题讨论】:

  • 请格式化问题。如果在 phpmyadmin 中执行查询时出现错误,请删除 php 和 mysqli 标签。
  • 哪个phpMyadmin版本?您是如何使用“插入”选项卡添加值的?你插入了什么值?如果您尝试插入单行作为测试,是否还会出现问题?尽管出错还是插入了数据,还是插入失败了?
  • 'SET NAMES utf8',);尝试{ $db = new PDO($dsn, $user, $pass,$options); $db -> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $q = "INSERT INTO items (name) VALUES ('منتج1')"; $db->e​​xec($q); } catch (PDOException $e){ echo 'faild' 。 $e ->getMessage(); }
  • 您的列idname 的数据类型是什么?它们是什么排序规则(如果有的话)?您使用的是哪个 phpMyAdmin 版本?
  • phpmyadmin版本4.6.5.2 id列是整数,name列是字符

标签: phpmyadmin


【解决方案1】:

我找到了解决方案here

从第 867 行替换:

    // Move to the next page or to the last one
    $endpos = $_SESSION['tmpval']['pos']
        + $_SESSION['tmpval']['max_rows'];

    if ($this->__get('unlim_num_rows') === false // view with unknown number of rows
        || ($endpos < $this->__get('unlim_num_rows')
        && $this->__get('num_rows') >= $_SESSION['tmpval']['max_rows']
        && $_SESSION['tmpval']['max_rows'] != self::ALL_ROWS)
    ) {

        $table_navigation_html
            .= $this->_getMoveForwardButtonsForTableNavigation(
                $html_sql_query, $pos_next, $is_innodb
            );

    } // end move toward

   // Move to the next page or to the last one
    if ($this->__get('unlim_num_rows') === false // view with unknown number of rows
        || ($_SESSION['tmpval']['max_rows'] != self::ALL_ROWS
        && $_SESSION['tmpval']['pos'] + $_SESSION['tmpval']['max_rows'] < $this->__get('unlim_num_rows')
        && $this->__get('num_rows') >= $_SESSION['tmpval']['max_rows'])
    ) {

        $table_navigation_html
            .= $this->_getMoveForwardButtonsForTableNavigation(
                $html_sql_query, $pos_next, $is_innodb
            );

    } // end move toward

【讨论】:

  • 这帮助我修复了它。
  • 有效。这是我要编辑的文件/usr/share/phpmyadmin/libraries/DisplayResults.php
【解决方案2】:

以上警告信息表明,此文件 /usr/share/phpmyadmin/libraries/sql.lib.php 的第 613 行存在问题

所以让我们去编辑那个文件并到达 613 行。

|| (count($analyzed_sql_results['select_expr'] == 1)

将此行替换为

|| (count($analyzed_sql_results['select_expr']) == 1

如果仍有任何问题,请恢复。

【讨论】:

    【解决方案3】:

    我在 Ubuntu Xenial 中关注了这些,问题得到了解决。

    sudo add-apt-repository ppa:phpmyadmin/ppa

    sudo apt-get 更新

    sudo apt-get install phpmyadmin

    参考: https://github.com/phpmyadmin/phpmyadmin/issues/15515

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-09-05
      • 2014-03-30
      • 2011-07-04
      • 2012-05-21
      • 1970-01-01
      • 2013-10-10
      • 1970-01-01
      相关资源
      最近更新 更多