dimanche 29 novembre 2015

Wordpress - mysql_query(): Access denied for user 'www-data'@'localhost' (using password: NO) error on production server

I'm getting a warning message when I enable wordpress debug mode.

Warning: mysql_query(): Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/html/blog/wp-content/plugins/test/manage_registrations.php on line 46

Warning: mysql_query(): A link to the server could not be established in /var/www/html/blog/wp-content/plugins/test/manage_registrations.php on line 46

PHP code:

$extrawhere1=" order by id desc LIMIT $start, $limit";
$sqlSearch="select * from visa where 1=1 $extrawhere $extrawhere1";
$query="select * from visa where 1=1 $extrawhere order by id desc ";
$_SESSION['export_data']=$query;

$num=@mysql_num_rows(mysql_query($query));
$select_product=mysql_query($sqlSearch);

I tried using

$select_product=$wpdb->query($sqlSearch);

But i'm still getting error message. This error is only appearing on production server and not on local server.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire