Post by daggart » Fri Sep 18, 2015 4:20 pm

Hi

Opencart version:- 1.5.6

I'd appreciate some help please.
Yesterday both my website and admin showed an error message

'Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead.....'

I search the forum and found it it might be an upgrade to PHP 5 that caused it.

I've edited BOTH the config.php and the admin/config.php files and change the db driver FROM mysql to mysqli.

However now I have this error on website and admin page

Parse error: syntax error, unexpected 'else' (T_ELSE), expecting function (T_FUNCTION) in /home/dagg00/public_html/system/database/mysqli.php on line 54

Many Thanks,

Amanda

Newbie

Posts

Joined
Fri Nov 15, 2013 1:19 am

Post by OSWorX » Fri Sep 18, 2015 9:27 pm

The solution (and bug) is typically OpenCart: from his posting I assume that he is using 1.5.6 (0).
And with that version this file

Code: Select all

../system/database/mysqli.php
is simply shit because not ready to use!

@daggart: download a later published pversion, e.g. 1.5.6.1 or better and replace the old file with the new.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by daggart » Fri Sep 18, 2015 11:04 pm

Thank you.

Yes I've already changed the config files to reflect driver mysqli and I'm receiving the above error.

@OSWorX I've replaced the mysqli.php with a version from 1.5.6.4 but now I've got another error with my vqmod.


Warning: mysqli::mysqli(): (HY000/1045): Access denied for user '******'@'localhost' (using password: YES) in /home/dagg00/public_html/vqmod/vqcache/vq2-system_library_db.php on line 12

Fatal error: Call to undefined method mysqli::escape() in /home/dagg00/public_html/vqmod/vqcache/vq2-system_library_db.php on line 20

I've tried clearing cache, but still receiving this error.

Thanks,

Amanda

Newbie

Posts

Joined
Fri Nov 15, 2013 1:19 am

Post by OSWorX » Fri Sep 18, 2015 11:21 pm

Welcome in the world of OpenCart ..
The file db.php had also massive changes from version to version - maybe 1.5.6.4 was too high, 1.5.6.1 should be enough.
Unfortunetaly you have to try the files from different versions (but always both, the mysqli and the db) and see which one can then be used.

At the end it could be that you have to update the whole shop to a better version then 1.5.6.0 (1.5.6.5_rc should be sued then).

One word about your provider: if I would do such with my customers (updating important server components/software) I would have at the end of the week not one customer anymore!

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by johnchene » Thu Jan 21, 2016 9:00 pm

I had the same problem.

Thank you so much, this saved me a lot of time and frustration.

JC

jpm

Newbie

Posts

Joined
Thu Jan 21, 2016 1:44 am

Post by ltoso » Fri Jan 29, 2016 1:18 pm

@johnchene
Hi,

i have 1.5.5.1 opencart and i am facing the same problem of getting deprcated error and simply changing

Code: Select all

define('DB_DRIVER', 'mysqli');
didn't work for me i also checked that there is a file lying that is mysqli.php and i also received the following error after changing the define parameter above

Parse error: syntax error, unexpected 'else' (T_ELSE), expecting function (T_FUNCTION) in /home/xxx/public_html/system/database/mysqli.php on line 54

Can you please tell me what fixed everything for you

Thanx

New member

Posts

Joined
Mon May 16, 2011 10:49 pm

Post by marciemarc » Tue Feb 23, 2016 7:55 am

I had the exact same problem with 1.5.5.1 due to change of host PHP to 5.6 (mijndomein).
First I updated both config.php files from mysql to mysqli
After this I had the same error in line 54.

I downloaded 1.5.6.1, and I only uploaded these files:

system/database/mysqli.php
and
system/library/db.php

Don't forget to put the rights to 755 of these files.

And after this all my error messages were gone. Now I have to reinstall VqMod, this is a challenge again !

Greetz,
Marciemarc

http://www.ikwileenschotel.nl


Newbie

Posts

Joined
Sat Mar 16, 2013 4:19 am


Post by werepair » Wed Jun 08, 2016 2:35 am

This just fixed my error message using the 1.5.6 files as above

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 195 guests