Jump to content

MSql Error When Editing or Adding a Product


Guest arcaneagenda

Recommended Posts

Guest arcaneagenda

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

Link to comment
Share on other sites

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);

}

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...