Reputation: 13216
What does the "function name must be a string error" message mean?
Fatal error: Function name must be a string in /home/speedycm/public_html/speedyautos/admincp/admincar_cls.php on line 222
Lines 190-222 in admincar_cls.php reads:
$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']);
Upvotes: 0
Views: 2267
Reputation: 1
*$this->showprice = CURRENCY . number_format($rows['price'], 2, '.', ',');*
Concating a define can cause some weird behavior, maybe this is where it is having a problem?
Upvotes: 0
Reputation: 26456
My bet is that
$rows = $this->_db->_fetch_row('DB_FETCH_ASSOC');
should be
$rows = $this->_db->fetch_row('DB_FETCH_ASSOC');
I don't know your database class, but if query() and num_rows() don't start with an underscore, fetch_row() probably shouldn't either. Wouldn't explain the line number too, though...
Upvotes: 1