Put image from Database in Marker

0

I have a database where I store the path of images which are in a folder, I want to bring the image using PHP and then put it in a marker, the code I have to do this is the following: that code take it out of link but I still can not see the images, how can I do this, I hope you can help me, thanks!

PHP to save images in FOLDER:

// Import db file.
require_once 'dbDetails.php';

// Upload folder.
$upload_path = 'uploads/';

// Get the server ip.
$server_ip = gethostbyname(gethostname());

// Create upload url.
$upload_url = 'http://' . $server_ip . '/userapp/' . $upload_path;

//response array 
$response = array();

PHP to get photo:

<?php

$conn=mysqli_connect( "localhost", "root", "123", "rta" ) or die("Could not connect: " .mysqli_error($conn) );
$getImage=mysqli_query($conn, "SELECT url FROM ts") or die("Could not retrieve image: " .mysqli_error($conn));
$path=mysqli_fetch_assoc($getImage) or die("Could not fetch array : " .mysqli_error($conn));

?>

<html>
<head><title>Fetch image form mysql</title>
</head>
<body>

<img src="<?php echo 'uploads/'.$path['http:// .$server_ip . 
'/rta/' .$upload_path'];?>" />


<img src="<?php echo $path['image'];?>" />


</body>
</html>
    
asked by Armando 27.11.2017 в 23:21
source

0 answers