This is my error:
MySQL ERROR: Access denied for user 'www-data'@'localhost' (using password: NO)
And this is my set.php
<?php
$sitename = "http://www.URL.COM";
$link = mysql_connect("(ip site)", "root", "password");
$db_selected = mysql_select_db('database', $link);
mysql_query("SET NAMES utf8");
function fetchinfo($rowname,$tablename,$finder,$findervalue) {
if($finder == "1") $result = mysql_query("SELECT $rowname FROM $tablename");
else $result = mysql_query("SELECT $rowname FROM $tablename WHERE `$finder`='$findervalue'");
$row = mysql_fetch_assoc($result);
return $row[$rowname];
}
?>
I search all time answer but with no success.
As you're not using password, why you write like this:
$link = mysql_connect("(ip site)", "root", "password");
If your username = "root" on localhost then try to write the connection like the following way:
<?php
$link = mysql_connect('localhost', 'root', '{Your Password}');
if (!$link) {
die('Not connected : ' . mysql_error());
}
$db_selected = mysql_select_db('{Your DB Name}', $link);
if (!$db_selected) {
die ('Can\'t use {Your DB Name} : ' . mysql_error());
}
For details check: MySQL
Note: Try to use PDO or mysqli