Displaying images in web pages

from the Artful MySQL Tips List

The simplest way to display images in HTML is directly from the image file, eg ...

<align="center"><img src="name-of-image.png"&gt &lt/p>

which is one reason it's often recommended that you store such images directly on disk, and store paths to them in the MySQL database, so in PHP you can write ...

$res=mysqli_query$conn,... ) or exit( mysqli_error($conn) );
$row=mysqli_fetch_row$res ) or exit( mysqli_error($conn) );;
"&ltp align="center"&gt;&lt;img src='$picpath'&gt; &lt;p&gt;";

Last updated 16 Aug 2019

Return to the Artful MySQL Tips page