Deprecated: mysql_connect() error in Opencart 1.5.6.1

In my new xampp 1.8.3 installation, I installed Opencart 1.5.6.1 and received a deprecated warning message such as:
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

The quick way to resolve this issue is by making a small change to the config.php and admin/config.php files. In both these config.php files, look for the line
define('DB_DRIVER', 'mysql');

Modify the above line to
define('DB_DRIVER', 'mysqli');

The new line will simply connect to the database from system/database/mysqli.php file.

Comments

  1. but file config.php and admin/config.php empty, i cannot replace define('DB_DRIVER', 'mysql'); show me how to fix

    ReplyDelete
    Replies
    1. If you have installed Opencart, I believe these files especially admin/config.php should not be empty. It puts all your database credentials there. Did you create database in your host control panel prior to installing Opencart. Maybe you can also try doing a site-wide search for "define('DB_DRIVER', 'mysql')" to see where exactly it has placed it.

      Delete
  2. thanks for your help

    ReplyDelete
  3. thanks for your help

    ReplyDelete
  4. thanks my friend.

    ReplyDelete
  5. It fixed the issue. Thanks.

    ReplyDelete
  6. Hi there,
    I know this is an old thread, but I now have the above issue with my site.
    The problem I'm having is, my config file directory is empty, and I don't appear to have an admin/config file at all. I'm a bit of a novice so not 100% sure where to start looking, or how to resolve the issue :(

    ReplyDelete
  7. Still getting the issue at the top of my page, and I can't login to the admin panel to put the site into maintenance mode because of it.

    I changed the config.php file for both public and admin to use mysqli as the DB driver, wat do?

    ReplyDelete

Post a Comment

Popular posts from this blog

How to resolve 'res://ieframe.dll/acr_error.htm#' error (Internet Explorer stopped working while viewing a website)

htaccess: Redirecting multiple domains to the main domain

MailChimp API V2.0 SSL error solution