Post by jillc » Mon Sep 16, 2013 1:30 pm

I'm just setting up my new pc - I downloaded the latest Xampp (1.8.3), downloaded the latest OC (1.5.6) and then set up a shop. However, I keep getting error messages: "Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in (...) \system\database\mysql.php on line 6"
Sometimes I get a popup window with a whole long list of variables which it is apparently having trouble with.
What can I do?
Last edited by jillc on Mon Sep 16, 2013 6:01 pm, edited 1 time in total.

New member

Posts

Joined
Sat Sep 07, 2013 11:55 am

Post by rph » Mon Sep 16, 2013 2:15 pm

Download the mysqli database driver at:

https://raw.github.com/opencart/opencar ... mysqli.php

Upload it to your site then your config files to use mysqli.

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by jillc » Mon Sep 16, 2013 6:03 pm

Thanks rph. Your blood is worth bottling!

New member

Posts

Joined
Sat Sep 07, 2013 11:55 am

Post by CZechBoY » Tue Sep 17, 2013 10:25 pm

put the database driver there:

Code: Select all

system/database/mmysqli.php
and edit config.php (in root directory)

Code: Select all

define('DB_DRIVER', 'mmysqli');

Mass update product descriptions/Hromadná změna popisků zboží


User avatar
Active Member

Posts

Joined
Mon Mar 19, 2012 1:39 am
Location - Europe, Czech republic; Hradec Králové, Brno

Post by Buxworth » Tue Sep 17, 2013 10:33 pm

Many thanks

Buxworth

Newbie

Posts

Joined
Tue Sep 17, 2013 8:43 pm

Post by vladmx » Sat Oct 05, 2013 12:23 am

I followed CZechBoY instructions with file indicated by rph (the second one) and its working great. I also changed 'DB_DRIVER' line in config.php inside admin dir to eliminate the warnig message on the administrative pages.

However, with the mysqli driver I'm having problems with some characters displayed on the pages. I'm investigating how to fix it.

Newbie

Posts

Joined
Sat Oct 05, 2013 12:10 am

Post by vladmx » Sat Oct 05, 2013 12:48 am

Adding the following line after $this->mysqli->set_charset('utf-8'); in mmysqli.php fixed my problem with foreign characters being displayed as question marks:

$this->mysqli->query("SET NAMES 'utf8'");

PHP manual (http://php.net/manual/en/mysqli.set-charset.php) has the following note:

"This is the preferred way to change the charset. Using mysqli_query() to set it (such as SET NAMES utf8) is not recommended. See the MySQL character set concepts section for more information."

However, I couldn't find other way to make it work.

Newbie

Posts

Joined
Sat Oct 05, 2013 12:10 am

Post by sugarskull » Fri Dec 05, 2014 9:40 pm

Can I reopen this?

I am having a very similar issue. The solution above worked to an extent but I am still seeing an error relating to the vqcache:

Fatal error: Class 'DBmysqliz' not found in /home/*/public_html/shop/vqmod/vqcache/vq2-system_library_db.php on line 13

or Fatal error: Class 'mmysqli' not found in /home/*/public_html/shop/vqmod/vqcache/vq2-system_library_db.php on line 13

I have tried deleting all from the cache, but no cigar!
Short of installing a fresh store, I am short of answers of what to do?

Can someone please help?
This problem is because I changed my host - of which have a more recent php 5.5 version.

New member

Posts

Joined
Fri Nov 23, 2012 8:50 am

Post by uhhmnet » Wed Jan 07, 2015 4:08 am

@sugarskull

newer versions of OpenCart already contain the MySQLi driver.

simply edit config.php:

Code: Select all

define('DB_DRIVER', 'mysqli');
you should stop seeing errors.

cheers
-Lyle H.

Newbie

Posts

Joined
Wed Jan 07, 2015 4:04 am

Post by 528491 » Thu Jul 16, 2015 11:32 pm

uhhmnet wrote:@sugarskull

newer versions of OpenCart already contain the MySQLi driver.

simply edit config.php:

Code: Select all

define('DB_DRIVER', 'mysqli');
you should stop seeing errors.

cheers
-Lyle H.
Hello, sorry for bumping an old thread but I need to know couple of things regarding mysqli deprecation error, all on one place:
  • Which version of Opencart was the first to support the mysqli driver? Is 1.5.5.1 supporting it correctly?
  • If I use Opencart version that supports it, is the only step necessary to edit the config.php? No adding other lines of code mentioned in this thread?
  • If I do a clean install of a newer Opencart version that supports the mysqli driver by default when clean installed, and then import a backup of my old 1.5.5.1 Opencart database that used the old mysql extension, will there be incompatibilities in database tables?
  • What does actually enabling mysqli driver affect/alters in Opencart installation code? The Opencart code, the mysql database tables' code or both?
I will much appreciate the response, since searching the boards haven't helped me so far regarding these questions.

New member

Posts

Joined
Tue Apr 02, 2013 6:05 pm

User avatar
New member

Posts

Joined
Wed Aug 27, 2014 7:23 pm


Post by putinhk » Sat Oct 10, 2015 8:28 am

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

Anyone has more CLEARLY solutions?
i.e where to download/upgrade and config

Newbie

Posts

Joined
Sat Apr 02, 2011 3:00 pm

Post by IP_CAM » Tue Dec 01, 2015 1:34 am

putinhk wrote:Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDOAnyone has more CLEARLY solutions?
i.e where to download/upgrade and config
Just read here, that's all it takes!
http://forum.opencart.com/viewtopic.php ... 80#p572236
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by TAC » Wed Dec 02, 2015 10:08 pm

IP_CAM wrote:Just read here, that's all it takes!
http://forum.opencart.com/viewtopic.php ... 80#p572236
Ernie
I tried that but no luck :(

User avatar
TAC
Active Member

Posts

Joined
Sun Sep 26, 2010 1:33 am
Location - England

Post by TAC » Wed Dec 02, 2015 10:51 pm

For anyone else following after me the issue in my case was that my PHP version had been upgraded and the old OC store couldn't work with it.

I set the PHP version to a previous one and the errors etc. disappeared :D

User avatar
TAC
Active Member

Posts

Joined
Sun Sep 26, 2010 1:33 am
Location - England

Post by faca5 » Sat Dec 12, 2015 4:52 pm

Hello.

Why use old PHP if you can use latest with all features?

You can solve your mysql_connect() problem with this extension:
http://www.opencart.com/index.php?route ... n_id=23099

Izdelava spletne trgovine | Najem spletne trgovine | PHP programiranje


User avatar
New member

Posts

Joined
Wed Aug 27, 2014 7:23 pm


Post by IP_CAM » Sat Dec 12, 2015 11:32 pm


My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by DooooT » Wed Jan 13, 2016 1:02 am

Download the file from the following link:

https://raw.githubusercontent.com/openc ... mysqli.php

Then UPLOAD the file into the following directory:

/public_html/system/database

Then MODIFY the config.php file at the following directory:

First directory: /public_html
Second directory: /public_html/admin

In both directories look for the following:

define('DB_DRIVER', 'mysqli');

Chang only the underline mysqli to become mmysqli

the final looks will be as following:

define('DB_DRIVER', 'mmysqli');

Save the changes in both directories.

That is it Engoy!! :)

Newbie

Posts

Joined
Wed Jan 13, 2016 12:53 am

Post by Medina » Fri Jan 15, 2016 2:51 pm

solved my problem and help support very good, recommended, thank you very much.


faca5 wrote:Hello.

Why use old PHP if you can use latest with all features?

You can solve your mysql_connect() problem with this extension:
http://www.opencart.com/index.php?route ... n_id=23099

New member

Posts

Joined
Sat Dec 10, 2011 7:54 am

Post by thomash2 » Tue Jan 26, 2016 10:32 pm

There is a lot of conflicting recommendations here.
http://forum.opencart.com/viewtopic.php?f=20&t=133437
http://forum.opencart.com/viewtopic.php ... 6&p=530799
http://forum.opencart.com/viewtopic.php?f=181&t=151859

Some of the hosting services are now phasing out php 5.4 and forcing upgrades to 5.5 and 5.6.

I'm running an older version pre 1.5.6 and I can't get it to work with either php 5.5 or 5.6.
I tried changing define('DB_DRIVER', 'mysql'); to mysqli but there is an error because there is an extra bracket in the code "}". I read that the mysqli.php is not functional in older versions of opencart.

The mysqli.php file is identical from 1.5.5.1 through 1.5.6.3, with the same extra bracket "}".
However it looks very different on 1.5.6.4.

I also checked the version on Github, but it also looks very different from the version in 1.5.6.4. But it appears to be for 2.x? Will it work with pre 1.5.6?
https://github.com/opencart/opencart/bl ... mysqli.php

I also looked at the mysqliz extension, which also looks very different from all the others. Is this safe to use?
http://www.opencart.com/index.php?route ... n_id=13041

Which of these 3 versions of mysqli.php is best to use for pre-1.5.6?
The version in 1.5.6.4
The version from Github
The version in the mysqliz extension

I also get an error in my older version of vqmod when I attempt to switch to php 5.5 or 5.6:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in vqmod/vqmod.php ...

I read here to change the problematic line in the vqmod.php to:
$modFilePath = preg_replace_callback('/([^*]+)/', function ($m) { return preg_quote($m[1], "~"); }, $modFilePath);
http://forum.opencart.com/viewtopic.php?f=22&t=130679

If I decide to upgrade vqmod to the latest version using the "install" method, will I encounter additional problems, or is it safer to simply change this one line with the preg_replace_callback?

New member

Posts

Joined
Tue Jul 30, 2013 12:44 am
Who is online

Users browsing this forum: No registered users and 25 guests