MYSQLi Error after php5.5 upgrade

Any tips and tricks that has to with the interakt extensions that doesn't fit into one of the other categories
jamo
Posts: 19
Joined: 2011-01-10 18:59

MYSQLi Error after php5.5 upgrade

Post by jamo » 2019-09-09 16:01

Hi I'm getting a MySqli error after the upgrade to php 5.5 using Kollection Pro 3.7.1 Getting error on the back-end forms only. FYI (I disabled the login protection.)
PHP MySQL server model.

Error:

Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/includes/common/lib/db/KT_Connection.class.php on line 60 Notice: Trying to get property of non-object in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/tng/tNG_multipleUpdate.class.php on line 155 Warning: array_keys() expects parameter 1 to be array, null given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/includes/tng/tNG_multipleUpdate.class.php on line 155 Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/tng/tNG_multipleUpdate.class.php on line 165 Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/common/lib/db/KT_Connection.class.php on line 81 Warning: mysqli_error() expects parameter 1 to be mysqli, resource given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/common/lib/db/KT_Connection.class.php on line 94


Have I missed updating a script? or?

Jimmy

dboy321
Posts: 14
Joined: 2019-08-01 04:37

Re: MYSQLi Error after php5.5 upgrade

Post by dboy321 » 2019-09-10 07:57

jamo wrote: 2019-09-09 16:01 Hi I'm getting a MySqli error after the upgrade to php 5.5 using Kollection Pro 3.7.1 Getting error on the back-end forms only. FYI (I disabled the login protection.)
PHP MySQL server model.

Error:

Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/includes/common/lib/db/KT_Connection.class.php on line 60 Notice: Trying to get property of non-object in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/tng/tNG_multipleUpdate.class.php on line 155 Warning: array_keys() expects parameter 1 to be array, null given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/includes/tng/tNG_multipleUpdate.class.php on line 155 Warning: in_array() expects parameter 2 to be array, null given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/tng/tNG_multipleUpdate.class.php on line 165 Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/common/lib/db/KT_Connection.class.php on line 81 Warning: mysqli_error() expects parameter 1 to be mysqli, resource given in /var/www/vhosts/----/-------/webspace/httpdocs/mysite.com/common/lib/db/KT_Connection.class.php on line 94


Have I missed updating a script? or?

Jimmy
Jimmy, could you give us a little more information? For example, you stated you did a PHP5.5 upgrade.... "to" PHP 5.5 or "from" 5.5. Can you also state exactly the tools use are using, for example version of dreamweaver... how you connect to DB (for example PHP / MySQL). Is it only MX Kollection you are using? Did you upload any files from the site... which? Or did you edit MySQL to MySQLi manually? Talk soon.

jamo
Posts: 19
Joined: 2011-01-10 18:59

Re: MYSQLi Error after php5.5 upgrade

Post by jamo » 2019-09-12 12:49

Hi, as I said I'm using Kollection Pro 3.7.1 and DW8 with the php 5.5 patch http://www.interaktonline.info/files/63 ... PNGs..html
The version of php on the server is PHP 5.5 CGI (5.5.38)
I made no changes to the connection scripts to create the MySqli error, the site front end works fine. I assumed it was the updated scripts which caused the errors on the admin forms?

Thanks
Jimmy

dboy321
Posts: 14
Joined: 2019-08-01 04:37

Re: MYSQLi Error after php5.5 upgrade

Post by dboy321 » 2019-09-13 05:14

This approach will not work unless you have download the ADOdb files as per http://www.interaktonline.info/files/62 ... p-5.5.html and your pages have an ADOdb MySQLi connection.

Again, I have to stress... you need a ADOdb MySQLi / PHP (server behaviour) as opposed to the standard PHP / MySQL connection in Dreamweaver 8.

If you are not using an ADOdb / MYSQLi connection, you should use the following files as per this thread which should work on PHP 5.5 and 5.6, without having to do much else... however don't overwrite your config file (/includes/tng/tNG_config.inc.php):

http://www.interaktonline.info/files/51 ... ition.html

When you extract the zip file.... don't simply copy the folders onto your existing site as these folders contain just a few files while the others in the includes directory will contain many more.... open each directory and sub directory and copy upload the files rather than the directory to your site via ftp or control panel for example. Make a copy of your existing includes folder beforehand.

All the best.

dboy321
Posts: 14
Joined: 2019-08-01 04:37

Re: MYSQLi Error after php5.5 upgrade

Post by dboy321 » 2019-09-13 05:49

Addendum - this files will work on PHP 5.5 and PHP 5.6

If in doubt a breakdown of changes is here:

http://www.interaktonline.info/article/ ... P-5.3.html

(making changes to files and folders that are relevant to you).

Do not mix MySQL and MySQLi statements - based on what you have stated, stick to the MySQL approach. PHP jumps from 5.6 to PHP 7+ (nothing in between). Once you've hit PHP 7 you will need to use MySQLi.

You will need to turn off error reporting as your pages will be full of deprecated warnings.

Hope this helps.

jamo
Posts: 19
Joined: 2011-01-10 18:59

Re: MYSQLi Error after php5.5 upgrade

Post by jamo » 2019-09-24 16:07

Thanks, only back to this now will try this week.

Jimmy

jamo
Posts: 19
Joined: 2011-01-10 18:59

Re: MYSQLi Error after php5.5 upgrade

Post by jamo » 2019-09-25 11:25

Still loads of errors not just of the depreceated kind on php 5.5 I returned to 5.3.3 and calm has been restored.

Thanks ;)

Jimmy

Post Reply