0
<?php
require ("init.php");
?>
<head>
<script src="ajax.js"></script>
<script src="common.js"></script>
</head>
<body>
<?php
$query = "SELECT * FROM User1";
$result = mysqli_query($connection, $query);
echo '<form> ';
echo "Select a Users:";
echo '<select name="users" onchange="showUser(this.value)">';
while ($row=mysqli_fetch_assoc($result)){
echo $row=['Username'];
echo '<option value="'.$row=['Username'].'">'.$row=['Username'].'</option>';
}
echo '</select></form>';
?>
<div id="txtHint"><b>User info will be listed here.</b></div>
</body>
我遇到的問題是,在下拉框中僅顯示陣列多次,沒有顯示從我的數據庫的用戶名然而,我的數據庫連接是否正常工作tryed當作爲調試它得到了它呼應了只有一個用戶名PHP的Ajax下拉框
'$行= [ '用戶名']'這是分配一個數組$行變量。 – vaso123 2014-12-04 13:17:04
'$ row = ['Username']'在這裏不正確。 – 2014-12-04 13:17:09