I have been programming a page to allow you to be able to store passwords within a database and I am having an issue where the table is being printed out 3 times but I have no idea why. I wanted the table to be on the far right of the screen and to have a list downwards of passwords that you have entered into the mysql database but it is not working
Here is the code:
<?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
}
}
?>