How to fix the error: Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user ‘ODBC’@’localhost’ (using password: NO) in *.php on line *

You need a database connection prior to the functions..

$query = dbconnect(“select ‘test’;”);

(where dbconnect is a function to connect to the DB and “select ‘test’” is just a random query)


if (isset($_POST[‘submit’])){
$query = dbconnect(“select ‘test’;”);

$forename = mysql_real_escape_string(htmlspecialchars($_POST[‘forename’]));


Leave a Reply

Your email address will not be published. Required fields are marked *

Loading Facebook Comments ...
Loading Disqus Comments ...