Advertisement
Guest User

Untitled

a guest
Nov 7th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2. $servername='localhost';
  3. $username='root';
  4. $password='root';
  5.  
  6. $schema='demir';
  7.  
  8. $conn=mysql_connect($servername, $username, $password) or
  9. die('Connection failed : ' . $conn-> connect_error);
  10.  
  11. mysql_select_db($schema);
  12.  
  13. $result=mysql_query('SELECT * FROM topics');
  14.  
  15. echo '<h1>All Topics</h1><br>';
  16. echo '<table>';
  17. echo '<tr><td>ID</td><td>Name</td></tr>';
  18. while($row = mysql_fetch_assoc($result)){
  19. echo '<tr>';
  20. echo '<td>' .$row['id'].'</td>';
  21. echo '<td>' .$row['name'].'</td>';
  22. echo '</tr>';
  23. }
  24. echo '</table>';
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement