i just want to display images ( that are stored into database )in a dynamically create table which has dynamically row & 4 columns in php
like this:-
image1|image2|image3|image4
image5|image6|image7|image8
image9|image10 etc.

if a new image i upload in the database than it should come in third row third column and so on.

pls reply me soon on my email id

You need to create a loop. If you are pulling the images from a database which I presume you are else the basis is pretty much the same.

<?php

// You need to connect to the database.
$pull_images = mysql_query("SELECT * FROM `images` ORDER BY `upload_time` ASC");

if( @mysql_num_rows( $pull_images ) > 0 ) {
echo '<table>';
$count = 0;
while( $row = mysql_fetch_array( $pull_images ) ) {
if( $count == 0 ) {
echo "<tr><td>";
} else {
echo "<td>";
}
echo '<img src="' . $row['src'] . '" alt="' . $row['title'] . '" />';
if( $count == 3 ) {
echo '</td></tr>';
$count = 0;
} else {
echo '<td>';
$count++;
}
}

$cells_left = 4 - $count;
if( $cells_left > 0 ) {
$i = 0;
while( $i <= $cells_left ) {
echo '<td></td>';
$i++;
}
echo '</tr>';
}
echo '</table>';
} else {
echo "No images in the database.";
}

?>
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.