Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1451

Warning: mysql_real_escape_string error (no replies)

$
0
0
Hello there,

I need some help with a mysql connection issue with escaping characters.

I keep getting the following error on this page even though the databse, user and password are correct:


Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'xxxx'@'localhost' (using password: NO) in /home/elisabet/public_html/demo1/install.php on line 132


and lines 128- 132 say:

function secure($string) {
if (get_magic_quotes_gpc()) {
$string = stripslashes($string);
}
$string = mysql_real_escape_string($string);
return $string;
}

if ($_POST)
{
$error = "";
$db_host = $_POST['host'];
$db_username = $_POST['username'];
$db_password = $_POST['password'];
$db_name = $_POST['db'];

What is wron with the escaping of characters. I tried this on three different servers and still get the same error so the problem is in the code.
Thank you.

Viewing all articles
Browse latest Browse all 1451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>