close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Upgrade MySQL to MySQLi

Thread began 3/22/2021 9:47 am by joerg431091 | Last modified 6/21/2021 2:15 pm by joerg431091 | 2576 views | 25 replies

joerg431091

Thanks Ray,

I did the changes but I believe that somehow the automatic migration from mysql to mysqli might have screwed up a couple of things. For example, the automatic change of the recordset WADAproducts migrated to:

<?php
$WADAproducts = new WA_MySQLi_RS("WADAproducts",$Amiganien_DB_i,0);
$WADAproducts->setQuery("SELECT * FROM products WHERE ProductCategoryID = ? AND ProductStore LIKE '%%NA%%' OR ProductSubCatID = ? AND ProductStore LIKE '%%NA%%' OR ProductSubCat2ID = ? AND ProductStore LIKE '%%NA%%' ORDER BY ProductPrice ASC");
$WADAproducts->bindParam("i", "".(isset($_GET['ProductCategoryID'])?$_GET['ProductCategoryID']:"") ."", "-1"); //ProductCategory
$WADAproducts->bindParam("i", "".(isset($_GET['ProductCategory2ID'])?$_GET['ProductCategory2ID']:"") ."", "-1"); //ProductCategory2
$WADAproducts->bindParam("i", "".(isset($_GET['ProductSubCatID'])?$_GET['ProductSubCatID']:"") ."", "-1"); //subcategory2
$WADAproducts->execute();
?>

Looking at the line:

$WADAproducts->bindParam("i", "".(isset($_GET['ProductCategory2ID'])?$_GET['ProductCategory2ID']:"") ."", "-1"); //ProductCategory2

a ProductCategory2ID is showing up but there is no Category2 in the database and instead, there is a SubCat2 in the database which does not appear in the migrated recordset.


I thought that might be a reason why for example all the navigation links that refer to the SubCat2ID don't display the products from the database anymore.


So I tried changing the line to

$WADAproducts->bindParam("i", "".(isset($_GET['ProductSubCat2ID'])?$_GET['ProductSubCat2ID']:"") ."", "-1"); //ProductCategory2

not sure whether this would be correct or not because it did not fix the problem with the navigation.


However, besides the problem with the navigation links not showing products with a SubCat2ID, with the changes you suggested I now have the following errors in the products_detail.php page:

Notice: Undefined index: eCart1_1_size_Add in /Applications/MAMP/htdocs/NavariniUSA/products_detail.php on line 71

Notice: Undefined index: eCart1_1_ID_Add in /Applications/MAMP/htdocs/NavariniUSA/products_detail.php on line 72

Notice: Undefined index: eCart1_1_size_Add in /Applications/MAMP/htdocs/NavariniUSA/products_detail.php on line 73

Notice: Undefined index: eCart1_1_ID_Add in /Applications/MAMP/htdocs/NavariniUSA/products_detail.php on line 74

Fatal error: Uncaught Error: Call to undefined function mysql_escape_string() in /Applications/MAMP/htdocs/NavariniUSA/products_detail.php:23 Stack trace: #0 /Applications/MAMP/htdocs/NavariniUSA/products_detail.php(96): GetSQLValueString('', 'int') #1 {main} thrown in /Applications/MAMP/htdocs/NavariniUSA/products_detail.php on line 23

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...