Guest User

Untitled

a guest
Jun 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. I have this code so far: I'd also like to make a picture link, if you could help me with that. Short explained: I want the image to link to the next id.
  2.  
  3. <?php
  4. if (isset($_GET['id']))
  5. {
  6. $id = intval($_GET['id']);
  7.  
  8. $sql = "select * from people WHERE id=$id LIMIT 1";
  9. $result = mysql_query($sql) or die ("Kunne ikke koble til databasen. " . mysql_error());
  10.  
  11. while ($row = mysql_fetch_assoc($result))
  12. {
  13. echo "<div class=\"picture\">";
  14. echo "<p>";
  15.  
  16. // Link
  17. echo "<a href=''><img src=\"../uploads/" . $row['filename'] . "\" alt=\"\" /></a>";
  18. echo "</p>";
  19. echo "</div>";
  20. }
  21. }
Add Comment
Please, Sign In to add comment