Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo
- "
- <center>
- <table>
- <tr>
- <td> <a href='Form.html' style='underline'>Insert Record</a> </td>
- <td> <a href='UpdateRecord.html'>Update Record</a>
- <td> <a href='DeleteRecord.html'>Delete Record</a>
- </tr>
- </table>
- ";
- $con = mysqli_connect("localhost","root","","mscit");
- if(!$con)
- {
- die("Error".mysqli_error());
- }
- else
- {
- //none
- }
- $dbselect ="select * from login";
- $result = mysqli_query($con, $dbselect);
- if (mysqli_num_rows($result) > 0)
- {
- echo "<table border='0' align='center'>";
- echo "<tr>
- <td> Username </td>
- <td> Password </td>
- <td> Gender </td>
- <td> City </td>
- <td> Email </td>
- <td> Age </td>
- <td> Delete </td>
- </tr>";
- // output data of each row
- while($row = mysqli_fetch_assoc($result))
- {
- echo "<tr>";
- echo "<td>".$row["username"]."</td>";
- echo "<td>".$row["password"]."</td>";
- if($row["gender"]=="M")
- echo "<td>Male</td>";
- else
- echo "<td>Female</td>";
- echo "<td>".$row["city"]."</td>";
- echo "<td>".$row["email"]."</td>";
- echo "<td>".$row["age"]."</td>";
- echo "<td><a href='delete.php?un=".$row["username"]."'>Delete</a></td>";
- echo "</tr>";
- //echo "<br>Usernaem : ".$row["username"]. " Password : ".$row["password"]." Age : ".$row["age"]. "<br>";
- }
- echo "</table>";
- }
- else
- {
- echo "0 results";
- }
- echo " </center>";
- ?>
Add Comment
Please, Sign In to add comment