Guest User

Untitled

a guest
Jul 2nd, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <?php
  2. $mysql_host = "localhost";
  3. $mysql_database = "opthabas_db";
  4. $mysql_user = "opthabas_user";
  5. $mysql_password = "password";
  6. $con = mysql_connect($mysql_host, $mysql_user, $mysql_password);
  7. if (!$con)
  8. {
  9. die('Could not connect: ' . mysql_error());
  10. }
  11. mysql_select_db("opthabas_db", $con);
  12.  
  13. $sql = "SELECT Images FROM Profile";
  14. $stid = oci_parse($con, $sql);
  15. oci_execute($stid);
  16. $row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS);
  17. if (!$row) {
  18. header('Status: 404 Not Found');
  19. } else {
  20. $img = $row['Image']->load();
  21. header("Content-type: image/jpeg");
  22. print $img;
  23. }
  24.  
  25. mysql_close($con)
  26. ?>
Add Comment
Please, Sign In to add comment