本地用户拒绝访问被拒绝

时间:2015-01-08 14:21:49

标签: php admin edit

尝试创建一个能够编辑用户的管理面板。我有一个编辑用户按钮,当点击时告诉我错误,但是我已经创建了一个帐户,所有权限名为admin,密码为admin,但它仍然告诉我localhost存在问题。使用XAmpp。

http://postimg.org/image/p8teaqdgp/     ErrorAccess拒绝用户''@ localhost'到数据库'mxwebsite'

以下是我的editusers.php:

<?php
include 'adminpage.php';
include 'connection.php';
mysql_select_db( "mxwebsite" ) or die( 'Error'. mysql_error() );
$query = "SELECT * FROM Users";
$result = mysql_query($query)or die(mysql_error());

echo "<table>";
echo "<tr><th>UserID</th><th>First Name</th><th>Last Name</th><th>Email</th><th>D-O-B</th></tr>Username</th><th>Password</th><th>";

while($row = mysql_fetch_array($result)){

$userid = $row['UserID'];
$firstname = $row['FirstName'];
$lastname = $row['LastName'];
$email = $row['Email'];
$dob = $row['DateofBirth'];
$username = $row['Username'];
$password = $row['Password'];

// Now for each looped row

echo "<tr><td style='width: 200px;'>".$userid."</td><td style='width: 200px;'>".$firstname."</td><td>".$scale."</td><td>".$lastname."</td><td>".$email."</td></tr>".$dob."</td></tr>".$username."</td></tr>".$password."</td></tr>";

} // End our while loop
echo "</table>"

?>

这是我的connection.php:

<?php

$connection = mysqli_connect('localhost', 'root', '', 'mxwebsite') or exit;

?>

0 个答案:

没有答案