Only Single image is display .guide how i display multiple image in our page in php
i am sending coding . there are two file1.php and file2.php .guide me

file1.php

<?php
header("content-type:image/jpeg");
$con=mysql_connect('localhost','root','');
if(!$con)
{
	die("colud not open");
}
$d=mysql_select_db("test1");
if(!$d)
{
	die("colud not open");
}
$q1=mysql_query("select * from img1");
	
while($r=mysql_fetch_array($q1))
{
	//$id=$r['id'];
	//$filename=$r['filename'];
	//$filetype=$r['filetype'];
	//$filesize=$r['filesize'];
	//$m=$r['masterimage'];
	  $mm=$r['thumbnail'];	
	  
	  //header("Content-type: image/jpeg");
	echo $mm;
	
	
	}
?>

file2.php

<?php
$con=mysql_connect('localhost','root','');
error_reporting(E_ALL);

if(!$con)
{
	die("colud not open");
}
$d=mysql_select_db("test1");
if(!$d)
{
	die("colud not open");
}
//id=$_GET['id'];
$q1=mysql_query("select * from img1");
echo "<table>";
echo "<tr>
	<td>id</td>
	<td>filename</td>
	<td>filetype</td>
	<td>filesize</td>
	<td>master</td>
	</tr>";
while($r=mysql_fetch_array($q1))
{
	$id=$r['id'];
	$filename=$r['filename'];
	$filetype=$r['filetype'];
	$filesize=$r['filesize'];
	//$m=$r['masterimage'];
	  $mm=$r['thumbnail'];	
	echo "<tr>
			<td>$id</td>
			<td>$filename</td>
			<td>$filetype</td>
			<td>$filesize</td>";
		echo '<img  src="img3.php" >
			</tr>';
}
?>			
</table>

dont understand what you want to achieve.

do you want to display the header info / details about some images or would you like a repeat region / loop to loop through multiple images?

in addition to this, do you store the filenames of the images in the database or do you use global or fopen to read directories?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.