3
votes

I have an OpenCart installation with vqmod.

Recently moved to a server with a newer version of PHP which says mysql is deprecated.

So I edited config.php to make OpenCart use mysqli instead of mysql.

Unfortunately, now getting the error

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

1
Either your edits went wrong, or your version of OpenCart doesn't supporting Mysqli. In any case, mysql remains supported for the time being. You could just ignore the message, unless it's displaying on your pages. - user1864610
PHP message was pretty clear: using mysql was returning a fatal error as well...fatal error for using deprecated mysql function... - OC2PS
Deprecated functions issue an E_DEPRECATED message, but are not fatal. The error message here refers to mysqli::escape(), which doesn't exist, nor does mysql::escape(). - user1864610
You are right. Turns out I was conflating 2 messages. By switching from mysqli to mysql I was getting a deprecated message, AND another fatal error related to mcrypt which I hadnt enabled on the new server. Thanks! - OC2PS
Also, it turns out that the OpenCart developer made some recent changes which have broken its mysqli. Hopefully this will get fixed soon. - OC2PS

1 Answers

3
votes

Use this library mysqliz: http://www.opencart.com/index.php?route=extension/extension/info&extension_id=13041

Edit your config.php to make OpenCart use mysqliz instead of mysqli.