MySQL Forums
Forum List  »  PHP

pictures from database
Posted by: Justyna Cala
Date: April 15, 2013 01:46PM

So I've got images' path stored in my database for each object and I want to display the images on my webpage. I though i could do it for each element with following code:
<?php
$con=mysqli_connect("x","x","x","x");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($con,"SELECT imagesource FROM staff WHERE id=1");
echo '<img id="steve" src="'. $result . '"' . 'alt="Steve" class="thumbnail" />';

mysqli_close($con);
?>

Options: ReplyQuote


Subject
Written By
Posted
pictures from database
April 15, 2013 01:46PM
April 17, 2013 07:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.