• Hello.

    I have WordPress v3.9.2, PHP v5.5.14, MySQL v5.1.73 and WooCommerce v2.1.12.

    I have installed Pie Register and in the “General Settings”, I receive this error:

    MySQL Version
    Warning: mysql_get_server_info(): No such file or directory in /homepages/41/xxx/htdocs/xxx/wp-content/plugins/pie-register/menus/PieGeneralSettings.php on line 456

    Warning: mysql_get_server_info(): A link to the server could not be established in /homepages/41/xxx/htdocs/xxx/wp-content/plugins/pie-register/menus/PieGeneralSettings.php on line 456

    Warning: mysql_get_server_info(): No such file or directory in /homepages/41/xxx/htdocs/xxx/wp-content/plugins/pie-register/menus/PieGeneralSettings.php on line 462

    Warning: mysql_get_server_info(): A link to the server could not be established in /homepages/41/xxx/htdocs/xxx/wp-content/plugins/pie-register/menus/PieGeneralSettings.php on line 462
    Sorry, Pie-Register requires MySQL 5.0 or higher. Please deactivate Pie-Register

    What can be the problem?

    Thanks in advance.

    https://ww.wp.xz.cn/plugins/pie-register/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter WP_cualquiera

    (@wp_cualquiera)

    I’ve been investigating, and mysql_get_server_info() is deprecated for PHP >= v5.5.0

    That explains why I receive errors also after a user registers using this form.

    Thread Starter WP_cualquiera

    (@wp_cualquiera)

    I have made a workaround, which for the moment works.

    I’m not a programmer, so please don’t think this is a perfect fix.

    PieGeneralSettings.php, change line 488 by:

    <?php if(version_compare($mysqli->server_info,  "5.0") == 1)
    		  {
    			  echo '<span class="installation_status">'.$mysqli->server_info.'</span>';
    		  }
    		  else
    		  {
    			  echo '<span class="installation_status_faild">'.$mysqli->server_info.'</span>';

    base.php, change line 758 by (look at the sourcecode of the webpage, because some code is missed):
    $user = $wpdb->get_results(“SELECTID,user_login,user_nicename,user_email,user_registeredFROM".$user_table."WHEREuser_email= ‘”.stripslashes($user).”‘”);

    I wish someone fixes this problem, and meanwhile this helps someone else 🙂

    Plugin Contributor genetech

    (@genetech)

    Hello,

    Thank you for pointing out this issue, there is quick work around for this, however it will be fixed in our next release.

    $piereg_mytsql_version_info = "";
       global $wpdb;
       if ( function_exists( 'mysqli_connect' ) ){
        if ( defined( 'WP_USE_EXT_MYSQL' ) ){
         //mysql
         $piereg_mytsql_version_info = mysql_get_server_info($wpdb->dbh);
        } elseif ( version_compare( phpversion(), '5.5', '>=' ) || ! function_exists( 'mysql_connect' ) ) {
         //mysqli
         $piereg_mytsql_version_info = mysqli_get_server_info($wpdb->dbh);
        } elseif ( false !== strpos( $GLOBALS['wp_version'], '-' ) ) {
         //mysqli
         $piereg_mytsql_version_info = mysqli_get_server_info($wpdb->dbh);
        }else{
         //mysql
         $piereg_mytsql_version_info = mysql_get_server_info($wpdb->dbh);
        }
       }else{
        //mysql
        $piereg_mytsql_version_info = mysql_get_server_info($wpdb->dbh);
       }
       if(version_compare($piereg_mytsql_version_info,  "5.0") == 1)
       {
        echo '<span class="installation_status">'.$piereg_mytsql_version_info.'</span>';
       }
       else
       {
        echo '<span class="installation_status_faild">'.$piereg_mytsql_version_info.'</span>';
        echo '<span class="quotation">'.__("Sorry, Pie-Register requires MySQL 5.0 or higher. Please deactivate Pie-Register","piereg").'</span>';
       }

    You can replace this code to fix this!

    Thanks

    Thread Starter WP_cualquiera

    (@wp_cualquiera)

    Thank you very much!

    And what about base.php? I don’t know if my fix is correct 😉

    Plugin Contributor genetech

    (@genetech)

    I did not test your fix, it is good as long as it works for you!
    This problem will be fixed natively in our upcoming release which is due next week!

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Error with MySQL’ is closed to new replies.