3

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

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
OC2PS
  • 1,037
  • 3
  • 19
  • 34
  • 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. –  Sep 25 '13 at 21:39
  • PHP message was pretty clear: using mysql was returning a fatal error as well...fatal error for using deprecated mysql function... – OC2PS Sep 25 '13 at 21:41
  • 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()`. –  Sep 25 '13 at 21:47
  • 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 Sep 25 '13 at 21:59
  • Also, it turns out that the OpenCart developer made some recent changes which have broken its mysqli. Hopefully this will get fixed soon. – OC2PS Sep 25 '13 at 22:01

1 Answers1

3

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.

  • I have the same problem, but after changing it to the mysqliz driver I still get `Class 'DBmysqliz' not found in vqmod/vqcache/vq2-system_library_db.php on line 13`. Can you explain why this file is supposed to work? – DJ_Beardsquirt Feb 13 '15 at 15:12