You are here:  » Upgraded to 15


Upgraded to 15

Submitted by TWDesigns on Wed, 2015-09-09 15:43 in

Greetings. I recently updated a site to 15/01a and it may or may not be related but I get various SQL errors.

mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /pt/includes/database.php on line 38

The above appears when I click brand mapping for example. Several other sections give me errors as well.

Thanks,
Tommy

Submitted by support on Wed, 2015-09-09 15:59

Hi Tommy,

There are a couple of new tables in 15/* so in order to add these if you browse to

/pt/setup.php?installDB=1

...that will create the new tables for brand mapping, category hierarchy mapping etc, but there is one final change that you will need to apply which is to add the new `categoryid` field to the pt_products table for Category Hierarchy Mapping support. The following dbmod.php script (run from /pt/ folder) will do this to complete the upgrade:

<?php
  set_time_limit
(0);
  require(
"includes/common.php");
  
$sql "ALTER TABLE `".$config_databaseTablePrefix."products` ADD categoryid INT(11) NOT NULL default '0'";
  
database_queryModify($sql,$result);
  
$sql "CREATE INDEX categoryid ON `".$config_databaseTablePrefix."products` (categoryid)";
  
database_queryModify($sql,$result);
  print 
"Done.";
?>

The setup process intentionally does not DROP or apply any changes so all feed registrations, existing mappings etc. will all remain in place.

Cheers,
David.
--
PriceTapestry.com

Submitted by TWDesigns on Wed, 2015-09-09 16:06

David,

The first step resolved the issues. I continued and created a file named dbmod.php and included the above script. When ran I get the following error.

Fatal error: Call to undefined function database_queryModify() in dbmod.php on line 4

Submitted by support on Wed, 2015-09-09 16:09

Sorry Tommy I accidentally deleted too much from the dbmod script I copied the code from - corrected above, with call to require includes/common.php...!

Cheers,
David.
--
PriceTapestry.com

Submitted by TWDesigns on Wed, 2015-09-09 17:31

That appears to be working but the only other issue I have is it's timing out. Does this modify the products in any way. I have almost 700k :(

Thanks,
Tommy

Submitted by TWDesigns on Wed, 2015-09-09 17:44

David I spoke too soon. I tried again and it finished the process.

Thank you~!