0

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>

Edited by nav33n: Use the snippet textbox to post your working and fully tested code snippet.

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by sallecpt
0

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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.