Solved

mysql_connect issue on xampp and opencart

Posted on 2016-08-09
3
64 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 108

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 82

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

Easy Project Management (No User Manual Required)

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now