Thanks for your reply, i shortended my code a bit: <?php
if(isset($_GET["value"])){
$value = $_GET["value"];
$conn = new SQLConnection();
$conn->insertData($value);
}
class SQLConnection{
public $servername = "localhost";
public $username = "scalar_sql";
public $password = "";
public $dbname = "scalar_measurements";
function __construct(){
}
function insertData($value){
$link = mysqli_connect($servername,$username, $password, $dbname);
if (!$link) {
die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
}
echo 'Success... ' . mysqli_get_host_info($link) . "\n";
mysqli_close($link);
}
}
?>
As you can see here, i created a new user and assigned it to the database but i still get the same error, i don't know what i am doing wrong In particular i don't understand why it is Access denied for user ''@'localhost'" , why doesn't the real username show up?