To use mysql_real_escape_string() function, you need to add database connection script as shown below.
PHP Code:
<?php
$conn = mysql_connect("mysql#.000webhost.com", "a336xxxx_test","******") or die(mysql_error());
mysql_select_db("a336xxxx_test", $conn);
$uname="bill";
$pword="fred";
$creds=sprintf("uname='%s', pword='%s'", mysql_real_escape_string($uname), mysql_real_escape_string($pword));
print($creds);
?>
I tested a code similar to above in my localhost server, and it works fine.
Just for your information:
Even if "mysql#.000webhost.com" is used as host in database connection script, the error message
will show something like 'a1345185'@'localhost' if there's something wrong with the script.
In other words, it's normal to have 'localhost' in the error message.