Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $db_database = 'test';
- $db_host = 'localhost';
- $db_user = 'root';
- $db_password = '';
- $conn = mysqli_connect($db_host, $db_user, $db_password, $db_database);
- $rows = mysqli_query($conn,'SELECT * FROM students');
- ?>
- <table border="1">
- <tr>
- <th>Name</th>
- <th>Address</th>
- <th>Email</th>
- <th>Mobile</th>
- </tr>
- <?php
- while( $row = mysqli_fetch_array($rows, MYSQLI_ASSOC) ) {
- echo "<tr>\n";
- echo "<td>{$row['name']}</td><td>{$row['address']}</td> <td>{$row['email']}</td> <td>{$row['mobile']}</td>\n";
- echo "</tr>\n";
- }
- ?>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement