Hello! tell me, here I have a base, there is a table with 3 fields in it - id
, pic
, name
. The id
stores the number, the pic
stores the image, and the name
holds the name of the image. The question is: how can I display images stored in the pic
field to the site page?
$query = "select * from tab1 where name like '%".$name."%'"; $result = mysql_query($query); $num_results = mysql_num_rows($result); echo '<p><strong>Count result : '.$num_results.'</p>'; for ($i=0; $i <$num_results; $i++) { $row = mysql_fetch_array($result); echo '<p><strong>'.($i+1).'. Id : '; echo stripslashes($row['id']); echo '<br />Image: '; echo stripslashes($row['pic']); <img src="data:image/jpg;base64,<?=base64_encode($row['pic'])?>" /> echo '<br />Image name: '; echo stripslashes($row['name']); }