我在我的数据库上创建了一个成员表,并将用户名行作为用户输入,将密码行作为密码输入。然后我编写了一个脚本,该脚本必须在数据库中显示密码和用户名。就是这个:
<?PHP
$user_name = "root";
$password = "Hunter123";
$database = "adventure_of_dragons";
$server = "127.0.0.1";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
$SQL = "SELECT * FROM members";
$result = mysql_query($SQL);
while ( $db_field = mysql_fetch_assoc($result) ) {
$id = array($db_field['member_id']); "<BR>";
$username = array($db_field['username']); "<BR>";
$password = array($db_field['password']); "<BR>";
$rank = array($db_field['rank']); "<BR>";
print_r($username);
print_r($password);
}
mysql_close($db_handle);
}
else {
print "Database NOT Found " . $db_handle;
}
?>
但是当我运行代码时,它会显示:
数组 ( [0] => 用户 ) 数组 ( [0] => 密码 )
如何让它显示这样的文本:
-用户密码
请帮忙。