Closed vadimwe closed 8 years ago
Solved. Required PHP 5.5 for normal usage, if you have PHP < 5.5, change $cache[$currency->code] TO $cache[$currency['code']] etc.
It depends on how you have set the "fetch" key in app/config/database.php.
'fetch' => PDO::FETCH_CLASS, <-- Returns a StdClass object
'fetch' => PDO::FETCH_ASSOC, <-- Returns an Array
If result of the query is an array ... Yes you have this error.
What about force $currency to be an object?
foreach ($db->table($table_name)->get() as $currency)
{
$currency = (object) $currency;
$cache[$currency->code] = array(
'id' => $currency->id,
'title' => $currency->title,
'symbol_left' => $currency->symbol_left,
...
I've upped the minimum PHP version to 5.5.9.
Strange error on production server... Any ideas? Cache cleanup & clear done.