Im getting this error when Im trying to update data in the database. this is my database.php file
<?php
$db_name = "db";
$db_server = "localhost";
$db_user = "xxxx";
$db_pass = "zzzzzzzzz";
$mysqli = new MySQLi($db_server, $db_user, $db_pass, $db_name)
or die(mysqli_error());
?>
update.php
<?php
require 'database.php';
$title = mysql_real_escape_string($_POST['title']);
$id = mysql_real_escape_string($_POST['id']);
$update_query = "UPDATE photos SET title = '$title' WHERE id='$id'";
$result = $mysqli->query($update_query) or die(mysqli_error($mysqli));
if ($result) {
echo "Success!";
echo "The title of this photo has been changed to: <strong>$title</strong>";
}
?>
The error message:
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\myPhotosWebsite\changePhotoTitle.php on line 5