Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2. $network = $_GET['network_name'];
  3.  
  4. $conn = new PDO('mysql:host=sql.computerstudi.es;dbname=gc200339389', 'gc200339389', 'dFqU^s25');
  5.  
  6. $sql = "SELECT * FROM 'shows' WHERE network_name = :network_name";
  7. $cmd->execute([":network_name" => $network]);
  8. $cmd = $conn->prepare($sql);
  9. $cmd-> execute();
  10. $shows = $cmd->fetchAll();
  11.  
  12. echo '<table class="table table-striped"><thead><th>Show Name</th><th>First Year</th><th>Network Name</th></thead><tbody>';
  13.  
  14. foreach ($shows as $show) {
  15. echo '<tr><td>' . $show['show_name'] . '</td>
  16. <td>' . $show['first_year'] . '</td>
  17. <td>' . $show['network_name'] . '</td>
  18. </td></tr>';
  19. }
  20.  
  21. echo '</tbody></table>';
  22.  
  23. //7. disconnect
  24. $conn = null;
  25. ?>
  26.  
  27. </body>
  28. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement