reaganm Posted February 26, 2016 Share Posted February 26, 2016 Hey I just made an upgrade to 6.2 . Im getting a error on my website suddenly. The following code No longer works: <?php // below details need to be taken from you configuration.php root $db_host = 'secret'; $db_username = 'secret'; $db_password = 'secret'; $db_name = 'secret';//not going to tell you, lol $mysqli = new mysqli($db_host, $db_username, $db_password, $db_name); $products = array(); if (mysqli_connect_error()) { die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); } $product_groups_query = "SELECT g.* FROM tblproductgroups g WHERE g.hidden !='on' ORDER BY g.order ASC"; if($product_groups = $mysqli->query($product_groups_query)) { while ($row = $product_groups->fetch_assoc()) { $group_products = array(); $group_id = $row['id']; $pull_products_per_group_query = " SELECT p.id AS product_id, p.name AS plan_name, p.description AS plan_description, tp.monthly AS plan_monthly_price, pc.prefix AS currency FROM tblproducts p LEFT JOIN tblpricing tp ON tp.relid = p.id AND tp.type = 'product' LEFT JOIN tblcurrencies pc ON pc.id = tp.currency WHERE p.gid = $group_id AND p.hidden !='on' ORDER BY p.order ASC"; $groups_products = $mysqli->query($pull_products_per_group_query); while( $subrow = $groups_products->fetch_assoc()) { $group_products[] = $subrow; } $products[] = array( 'group_name' => $row['name'], 'group_products' => $group_products ); } } $mysqli->close(); $this->assign('myproducts',$products); ?> I tried switching "$this->assign('myproducts',$products);" to "$template->assign('myproducts',$products);", but I get the error "Call to a member function assign() on a non-object in /home/reaganm/public_html/hmchosting.com/templates/ultimate/config.php on line 48". Please help a guy out. I dont want to have to revert my changes back to the old version of whmcs! If I remoe this, the site looks weird but is still functional. 0 Quote Link to comment Share on other sites More sharing options...
andy40 Posted February 26, 2016 Share Posted February 26, 2016 Sorry can't help still using 5.3 i would open a ticket with WHMCS 0 Quote Link to comment Share on other sites More sharing options...
Sliffer21 Posted February 27, 2016 Share Posted February 27, 2016 Here is some new documentation for connecting to WHMCS v6 and beyond. A good bit has changed with the 6.0 update. http://docs.whmcs.com/Interacting_With_The_Database 0 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.