Advertisement
adrianpascua

Untitled

Jun 2nd, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. include '../session.php';
  4. require_once 'config.php';
  5.  
  6. if (isset($_REQUEST['id'])) {
  7.  
  8. $query = "SELECT `id`, `image_name` FROM `crew_info` WHERE `id` = ? AND `image_name` = ?";
  9. $stmt = mysqli_prepare($conn, $query);
  10. mysqli_stmt_bind_param($stmt, 'is', $_REQUEST['id'], $image_name);
  11. mysqli_stmt_execute($stmt);
  12. mysqli_stmt_bind_result($stmt, $id, $image_name);
  13.  
  14. while (mysqli_stmt_fetch($stmt)) {
  15.  
  16. echo sprintf("%s", $image_name);
  17. }
  18.  
  19. $img_dir = "../updated_photo/";
  20. $images = glob($img_dir."*.jpg");
  21.  
  22. if (count($images) > 0) {
  23.  
  24. $img = $images[0];
  25. echo '<img src="'.$img.'" />';
  26.  
  27. }
  28. else {
  29. echo "No Image";
  30. }
  31.  
  32. }
  33.  
  34.  
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement