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 46Warning: 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.
Write these 2 lines at top of the file to check for any error
also check your config.php for db connection (correct or not)
May be load on your db has increased to the point where connections were unable to proceed further.
Check your database credentials. It seems like you are using an incorrect password. Or try:
Another possibility is you are using a mysqli connection and and trying to execute mysql_query.
Or try: