我的代码是这样的。每当我调用此函数时 -
$localhost = "localhost";
$user = "root";
$password = "";
function userID($username){
mysql_connect($localhost, $user, $password);
mysql_select_db("mydatabase");
$q = "SELECT ID FROM user WHERE Username='$username'";
$query = mysql_query($q);
while ($row = mysql_fetch_array($query)){
$return_value = $row['ID'];
}
return $return_value;
}
- 我收到此错误 -
Access denied for user 'ODBC'@'localhost' (using password: NO)
有什么不对?请告诉我?
答案 0 :(得分:0)
您的用户名,密码或两者都是错误的。