2011-03-11 85 views
0

“函数名称必须是字符串错误”消息的含义是什么?致命错误:函数名称必须是字符串

Fatal error: Function name must be a string in /home/speedycm/public_html/speedyautos/admincp/admincar_cls.php on line 222

线190-222在admincar_cls.php写着:

$this->_db->query($sql); 

if ($this->_db->num_rows()) 
{ 
    $rows = $this->_db->_fetch_row('DB_FETCH_ASSOC'); 
    $this->ownername = $rows['ownername']; 
    $this->owner_email = $rows['owner_email']; 
    $this->city = $rows['city']; 
    $this->state_id = $rows['state_id']; 
    //$this->caption=$rows[caption]; 
    $this->car_features = stripslashes($rows['features']); 
    $this->year = $rows['year']; 
    $this->make = $rows['make']; 
    $this->model = $rows['model']; 
    $this->color = $rows['color']; 
    $this->seller = $rows['userid']; 
    $this->dateadded = date("m/d/Y", $rows['date_added']); 
    $this->miles = $rows['miles']; 
    $this->city = $rows['city']; 
    $this->state = $rows['state_name']; 
    $this->owner_id = $rows['owner_id']; 
    $this->cstatus = $rows['cstatus']; 
    $this->trans = $rows['trans']; 
    $this->fuel = $rows['fuel']; 
    $this->drive = $rows['drive']; 
    $this->engine = $rows['engine']; 
    $this->vin = $rows['vin']; 
    $this->stocknum = $rows['stocknum']; 
    $this->hit_cnt = $rows['hit_cnt']; 
    $this->is_sold = $rows['is_sold']; 
    $this->country_name = $rows['country_name']; 
    $this->price = number_format($rows['price'], 2, '.', ','); 
    $this->showprice = CURRENCY . number_format($rows['price'], 2, '.', ','); 
    $this->expiry_date = date("m/d/Y", $rows['expiry_date']); 
+4

我们可以在这行之前和之后有更多的代码吗? – mauris 2011-03-11 04:18:58

+0

这意味着你不小心使用了类似'$ function()'的东西,函数名前加了'$',其中'$ function'没有被定义或者不对应一个字符串。虽然我在这里看不到这样的事情...... – BoltClock 2011-03-11 04:19:23

+2

另一个常见的罪魁祸首是偶然使用圆括号代替数组索引。 – 2011-03-11 04:20:41

回答

1

我敢打赌,

$rows = $this->_db->_fetch_row('DB_FETCH_ASSOC'); 

应该

$rows = $this->_db->fetch_row('DB_FETCH_ASSOC'); 

我不知道你的数据库类,但如果query()和num_rows()不启动机智h是下划线,fetch_row()可能不应该。虽然不会解释行号,但...

0

* $ this-> showprice = CURRENCY。 number_format($ rows ['price'],2,'。',','); *

Concating一个定义可能会导致一些奇怪的行为,也许这是它出现问题的地方?

相关问题