Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <?php include 'head.php';
  2.  
  3. $db = new mysqli($_ENV["DBHOST"], $_ENV["DBUSER"], $_ENV["DBPASSWORD"], $_ENV["DBNAME"]);
  4.  
  5. $sql = "select first_name, last_name from set1_actor where actor_id=?";
  6.  
  7. if ($stmt = $db->prepare($sql)) {
  8.  
  9. $stmt->bind_param("s", $_REQUEST['id']);
  10.  
  11. $stmt->execute();
  12.  
  13. $stmt->bind_result($first_name, $last_name);
  14.  
  15. if ($stmt->fetch()) {
  16. echo "Acteur n° ".$_REQUEST['id'].": ".$first_name." ".$last_name;
  17. }else{
  18. echo "Acteur n° ".$_REQUEST['id']." non trouvé.";
  19. }
  20.  
  21. }
  22.  
  23. $db->close();
  24. echo "</body></html>";
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement