Guest arcaneagenda Posted November 2, 2012 Share Posted November 2, 2012 Any help appreciated as I cant quite work this one out I get the error below when I click "edit" product after editing or adding a product Fatal error: Call to undefined method db::getFields() in /home/xxx/public_html/admin/sources/products/index.inc.php on line 185 line 185 is: $allowedFields = $db->getFields($glob['dbprefix'].'CubeCart_inventory'); Value any thoughts for a fix - many thanks AG Quote Link to comment Share on other sites More sharing options...
Toucan Web Design Posted November 2, 2012 Share Posted November 2, 2012 What version are you on of CC4? Wondering if you have an old database file, if you open up the following file, should see these lines of code right at the bottom: File: classes/db/db.inc.php ## New for 4.1.x function getFields($table) { global $glob; $list = mysql_list_fields($glob['dbdatabase'], $table, $this->db); $cols = mysql_num_fields($list); for ($i = 0; $i < $cols; ++$i) { $array = (array) mysql_fetch_field($list, $i); $return[$array['name']] = $array['name']; } return $return; } If that's not there, just try adding it in right after: function close() { mysql_close($this->db); } Quote Link to comment Share on other sites More sharing options...
Guest arcaneagenda Posted November 2, 2012 Share Posted November 2, 2012 Many thanks for the prompt response Toucan - very much appreciated I think that should sort it out! All the best AG Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted November 2, 2012 Share Posted November 2, 2012 As you can see, it's very useful to those who can help if you create a sig with your info in it. Quote Link to comment Share on other sites More sharing options...
Guest ShadyJ Posted November 15, 2012 Share Posted November 15, 2012 I got the same error and solved it trough the instructions given. Now its working. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.