致命错误:函数名称必须是字符串

时间:2011-03-11 04:16:08

标签: php

“函数名称必须是字符串错误”消息是什么意思?

  

致命错误:函数名称必须是第222行/home/speedycm/public_html/speedyautos/admincp/admincar_cls.php中的字符串

admincar_cls.php中的190-222行读取:

$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']);

2 个答案:

答案 0 :(得分:1)

我打赌是

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

应该是

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

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

答案 1 :(得分:0)

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

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

相关问题