I have the image URL saved in my mySQL database.($imageid). How can I display images using their respective id? I want to display different images attached to different blog posts,as we see in regular blogs.
Thank you.
I have the image URL saved in my mySQL database.($imageid). How can I display images using their respective id? I want to display different images attached to different blog posts,as we see in regular blogs.
Thank you.
Unsure what stage you are, bit you need to query your 'table' for a single result, perhaps the ID? If the column was Imageid then you could display it like below in an array of results.
$con=mysqli_connect("localhost","user","pass","my_db");
$result = mysqli_query($con,"SELECT * FROM table");
while($row = mysqli_fetch_array($result))
{
echo '<img src="' . $row['Imageid'] . '">';
}
mysqli_close($con);