2014-01-29 98 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

相關問題