DB からループを使用してすべての画像を表示します。これは私のコードです。画像はバイト形式でデータベースに保存されます。ループを使用してすべての画像を取得して表示することはできません。たとえば、img1、img2、img3 など...私が間違っていることを知っている人はいますか?
$username = "root";
$password = "123";
$host = "localhost";
$database = "test";
@mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
@mysql_select_db($database) or die("Can not select the database: ".mysql_error());
$query = mysql_query("SELECT * FROM tbl_images");
while($row = mysql_fetch_array($query))
{
header('Content-type: image/jpg');
$content = $row['image'];
echo $content;
}