• Resolved donachy

    (@donachy)


    When I sumbit the form I get this error

    Warning</b>: mysql_query(): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) in <b>/web/htdocs/mysite.com/home/wps/wp-content/plugins/mail-subscribe-list/sml.php</b> on line <b>272</b>

    <b>Warning</b>: mysql_query(): A link to the server could not be established in <b>/web/htdocs/mysite.com/home/wps/wp-content/plugins/mail-subscribe-list/sml.php</b> on line <b>272</b>

    <b>Warning</b>: mysql_num_rows() expects parameter 1 to be resource, boolean given in <b>/web/htdocs/mysite.com/home/wps/wp-content/plugins/mail-subscribe-list/sml.php</b> on line <b>273</b>

    https://www.ads-software.com/plugins/mail-subscribe-list/

Viewing 2 replies - 1 through 2 (of 2 total)
  • As mentionned in older unresolved threads, i just got those warning myself and since mysql_query is now deprecated here’s how I managed to make it work again replacing (on sml.php) :

    $exists = mysql_query("SELECT * FROM ".$wpdb->prefix."sml where sml_email like '".$wpdb->escape($email)."' limit 1");

    by

    $exists = $wpdb->get_results(
    	"
    	SELECT *
    	FROM ".$wpdb->prefix."sml
    	WHERE sml_email like '".$wpdb->escape($email)."'
    	LIMIT 1
    	"
    );

    and

    if (mysql_num_rows($exists) < 1) {

    by

    if ( empty($exists) ) {

    Give it a try, hope it works for you too ??

    Plugin Author Garrett Grimm

    (@grimmdude)

    Hi There,

    This has been fixed in version 2.1.3

    -Garrett

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can't connect to local MySQL server’ is closed to new replies.