2014-01-29 84 views
0

当我制作一个角色时,我收到了有关游戏的警告,并且我经历了确认,错误:警告:mysql_num_rows()期望参数1是资源,在C中给出布尔值: xampp htdocs app/

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\app\class.engine.php on line 102 Unknown column 'ipaddress_reg' in 'field list

我想知道是什么了吧,我访问了我的本地主机/ phpMyAdmin的,但没有工作

100-103线:

final public function num_rows($sql) 
{ 
    return $this->mysql['num_rows']($this->mysql['query']($sql, $this->connection)); 
} 
+0

这会提示您的查询中存在错误。 –

+0

可能重复'$ this-> mysql'你可以尝试'返回$ this-> mysql ['num_rows'] ['query']($ sql,$ this-> connection);' –

+0

或者如错误消息所示''字段列表'中的未知列'ipaddress_reg' –

回答

0

的问题是他们与您的查询或你的骗局nection。还要检查主题表上是否存在ipaddress_reg列。

public function column_exists($table,$field) 
{ 
    $query = mysql_query("SELECT * FROM $table LIMIT 1",$this->connection); 
    $column = mysql_fetch_array($query); 

    return false; 

    if(isset($column[$field])) 
    { 
     return true; 
    } 
} 

public function is_connected() 
{ 
    if(!$this->connection){ return false; }else{ return true; } 
} 
+0

解析错误:语法错误,意想不到的T_PUBLIC在C:\ xampp \ htdocs \ app \ class.engine.php在线102 现场102:公共职能column_exists($ table,$ field) – user3250830

相关问题