Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "";
  5. $dbname = "to_do_list";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. $query = "SELECT `task`, `date_of_task`, `time_of_task`,`id` FROM `to_do_list`.`tasks`;";
  15.  
  16. $result = mysql_query($query) or die($query."<br/><br/>".mysql_error());
  17.  
  18.  
  19. while($row = mysql_fetch_array($result)){
  20. echo "<tr>".
  21. "<td>" . $row['task'] . "</td>".
  22. "<td>" . $row['date_of_task'] . "</td>".
  23. "<td>" . $row['time_of_task'] . "</td>".
  24. "<td> <button value="Edit" class="btn btn-warning"> </td>".
  25. "<td> <button value="Edit" class="btn btn-warning"> </td>".
  26. "</tr>";
  27. }
  28. mysql_close();
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement