Hello,
I am having some trouble with the mysql_real_escape_string() function.
It is giving me a warning each time I run the page…
"Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user ‘eric’@‘localhost’ (using password: NO) in /public_html/index.php on line 24
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /public_html/index.php on line 24"
<?php
@$link = new mysqli("localhost", "eric", "pass", "db");
if ($link->connect_error) {
die ("Error: " . $link->connect_error);
}
echo mysql_real_escape_string("Hi!");
@$link->close();
?>
What is wrong here?