我一直在編程一個頁面,讓您能夠在數據庫中存儲密碼,我有一個問題,其中表打印出來3次,但我不知道爲什麼。我想表是在屏幕最右邊的,並有向下的,你已經進入到MySQL數據庫的密碼列表,但它不工作與MySQL的PHP表錯誤
下面是代碼:
<?php
$tempUsername = $_SESSION['usernameBox'];
mysql_connect("localhost", "username", "password");
mysql_select_db("UserTables");
$sql = "SELECT * FROM $tempUsername";
$resultSet = mysql_query($sql);
while($info = mysql_fetch_array($resultSet)) {
$counter = count($info);
for($i = 0; $i < $counter; $i++) {
?>
<table align="right">
<th> Id </th <th> Website </th> <th> Password </th>
<tr>
<td align="center"> <?php echo $info['Id']; ?> </td>
<td align="center"> <?php echo $info['Website']; ?> </td>
<td align="center"> <?php echo $info['Password']; ?> </td>
</tr>
</table>
<?php
}
}
?>
請不要以明文形式存儲密碼。請參閱:https://crackstation.net/hashing-security.htm –
您可以在迭代循環內輸入一個完整的表格。當然你會得到一個完整的表,每個條目然後... – arkascha
在mysql_connect不是我的用戶名或密碼,但在表中,我希望他們看到的密碼。 – Holy