phpMyEdit for PHP7 and MySQLi

One of my clients uses phpMyEdit but unfortunately when we updated their web hosting account to PHP 7, phpMyEdit v5.7.1 stopped working. The changes required to phpMyEdit to make it work are pretty simple, mainly update the __construct function and migrated mysql_* calls to mysqli_*. My updated version of phpMyEdit is available for download below.

Here are the errors phpMyEdit v5.7.1 was throwing on PHP 7:

[03-May-2019 08:53:30 CST6CDT] PHP Fatal error:
Uncaught Error: Call to undefined function mysql_connect() in /home/.../public_html/.../phpMyEdit.class.php:317
Stack trace:
0 /home/.../public_html/.../phpMyEdit.class.php(3072): phpMyEdit->sql_connect()
1 /home/.../public_html/.../phpMyEdit.class.php(3111): phpMyEdit->connect()
2 /home/.../public_html/.../phpMyEdit.class.php(3372): phpMyEdit->execute()
3 /home/.../public_html/.../edit.php(169): phpMyEdit->phpMyEdit(Array)
4 {main}
thrown in /home/.../public_html/data/phpMyEdit.class.php on line 317

To upgrade phpMyEdit v5.7.1 to PHP 7+ I made the following changes:

  • the __construct functions
  • migrated the mysql_* calls to mysqli_*

You are welcome to use my updated copy of the phpMyEdit class file. Here is a download link to the class file with my changes:


Published by


Kimball is a website designer and developer in Goffstown, NH.

7 comments on:
“phpMyEdit for PHP7 and MySQLi”

  1. Hi,

    Unfortunately the above link to the updated phpMyEdit class is broken. Any chance to have it fixed soon? Thanks in advance!

  2. Can you help me where to put in phpMyEdit class file

    // Change character set to utf8

    1. At line 318, like so….

      function sql_connect() /* {{{ */
      $this->dbh = @ini_get(‘allow_persistent’)
      ? @mysqli_pconnect($this->hn, $this->un, $this->pw)
      : @mysqli_connect($this->hn, $this->un, $this->pw);
      mysqli_set_charset($this->dbh, “utf8”);

      } /* }}} */

    2. Modify the function sql_connect() with adding the follow 2 lines worked for me !!!

      function sql_connect() /* {{{ */
      $this->dbh = @ini_get(‘allow_persistent’)
      ? @mysqli_pconnect($this->hn, $this->un, $this->pw)
      : @mysqli_connect($this->hn, $this->un, $this->pw);

      mysqli_query($this->dbh,”set character_set_client=’utf8′”);
      mysqli_query($this->dbh,”set character_set_results=’utf8′”);

      } /* }}} */

Leave a Reply

Your email address will not be published. Required fields are marked *