Solved

mysql_connect issue on xampp and opencart

Posted on 2016-08-09
3
116 Views
Last Modified: 2016-08-17
I'm using OpenCart 1.5.4 to mimic a live website on my computer.  I'm using Xampp.
I'm getting this error:

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in G:\xampp\htdocs\steveshopoc\system\database\mysql.php on line 6

Some people have suggested that people with this issue should add this line to PHP.INI to get rid of it:
display_errors = Off

I've added that to multiple php.ini files in OpenCart and to Xampp's php.ini file, but i still get the error (after restarting the server and reopening the browser)

But even if it were hiding the error, should the error be happening?

Also, one site mentioned changing the line in OpenCart:
define('DB_DRIVER', 'mysql');
to
define('DB_DRIVER', 'mysqli');

when i do that, I get this error:
Error: Could not load database file mysqli!

Which makes me think the driver isn't installed...  but I can't seem to find it.

Any suggestions on what I can do to resolve this issue?

Thank you!

Steve
0
Comment
Question by:slightlyoff
3 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 41749153
This is a very common issue.  This article explains it all, and shows exactly what must be done to remove the problems.
https://www.experts-exchange.com/articles/11177/PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html

PHP / MySQLi  installation instructions:
http://php.net/manual/en/mysqli.installation.php
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41749402
1.  Never turn error reporting off.  How else will you know what to fix?  I leave it on even in 'production' because sometimes things change so people can tell me if there are problems.

2.  If your web host's current version of PHP still uses / supports 'mysql' instead of 'mysqli', you can be almost guaranteed that one day they will upgrade and your site will stop working.
1
 
LVL 1

Author Comment

by:slightlyoff
ID: 41759507
Thank you for your help.  Sorry for the delay in responding.  I haven't been back to the project since posting.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This article was initially published on Monitis Blog, you can read it here . When it comes to deciding which approach to website performance monitoring is best for your business, unfortunately, like so many options in life . . . it depends. In t…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question