•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,547 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,353 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1021 | Replies: 6
![]() |
•
•
Join Date: Aug 2007
Posts: 181
Reputation:
Rep Power: 0
Solved Threads: 0
Hello every body,
I made an image gallery, but the photos displaying repeatedly in each row, I want the seven pictures displaying in each row of the table, then starts from the other row and same for others, the attachment pictures show the problems, what should I do?
I made an image gallery, but the photos displaying repeatedly in each row, I want the seven pictures displaying in each row of the table, then starts from the other row and same for others, the attachment pictures show the problems, what should I do?
<?php
$select = mysql_query("SELECT * FROM gallery ORDER BY id DESC") or die(mysql_error());
echo "<table align=center>";
while($r = mysql_fetch_array($select)){
// extract($r);
$pic = $r['image'];
$pic = "UploadedImage/".$pic;
$id = $r['id'];
?>
<tr>
<td align="center"><b><?php print($r['title']); ?></b></td>
<td align="center"><b><?php print($r['title']); ?></b></td>
<td align="center"><b><?php print($r['title']); ?></b></td>
<td align="center"><b><?php print($r['title']); ?></b></td>
<td align="center"><b><?php print($r['title']); ?></b></td>
<td align="center"><b><?php print($r['title']); ?></b></td>
<td align="center"><b><?php print($r['title']); ?></b></td>
</tr>
<tr>
<td align="center"><?php print($r['description']); ?></td>
<td align="center"><?php print($r['description']); ?></td>
<td align="center"><?php print($r['description']); ?></td>
<td align="center"><?php print($r['description']); ?></td>
<td align="center"><?php print($r['description']); ?></td>
<td align="center"><?php print($r['description']); ?></td>
<td align="center"><?php print($r['description']); ?></td>
</tr>
<tr>
<td align="center"><?php print("<img width=150 height=150 src='$pic'>"); ?></td>
<td align="center"><?php print("<img width=150 height=150 src='$pic'>"); ?></td>
<td align="center"><?php print("<img width=150 height=150 src='$pic'>"); ?></td>
<td align="center"><?php print("<img width=150 height=150 src='$pic'>"); ?></td>
<td align="center"><?php print("<img width=150 height=150 src='$pic'>"); ?></td>
<td align="center"><?php print("<img width=150 height=150 src='$pic'>"); ?></td>
<td align="center"><?php print("<img width=150 height=150 src='$pic'>"); ?></td>
</tr>
<tr>
<td align="center"><?php print("<a href=\"admin.php?action=edit&id=$id\">Edit</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=edit&id=$id\">Edit</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=edit&id=$id\">Edit</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=edit&id=$id\">Edit</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=edit&id=$id\">Edit</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=edit&id=$id\">Edit</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=edit&id=$id\">Edit</a>"); ?></td>
</tr>
<tr>
<td align="center"><?php print("<a href=\"admin.php?action=delete&id=$id\">Delete</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=delete&id=$id\">Delete</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=delete&id=$id\">Delete</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=delete&id=$id\">Delete</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=delete&id=$id\">Delete</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=delete&id=$id\">Delete</a>"); ?></td>
<td align="center"><?php print("<a href=\"admin.php?action=delete&id=$id\">Delete</a>"); ?></td>
</tr>
<tr>
<td align="center"><?php print("<a href=\"full.php?id=$id\">Full Image</a>"); ?></td>
<td align="center"><?php print("<a href=\"full.php?id=$id\">Full Image</a>"); ?></td>
<td align="center"><?php print("<a href=\"full.php?id=$id\">Full Image</a>"); ?></td>
<td align="center"><?php print("<a href=\"full.php?id=$id\">Full Image</a>"); ?></td>
<td align="center"><?php print("<a href=\"full.php?id=$id\">Full Image</a>"); ?></td>
<td align="center"><?php print("<a href=\"full.php?id=$id\">Full Image</a>"); ?></td>
<td align="center"><?php print("<a href=\"full.php?id=$id\">Full Image</a>"); ?></td>
</tr>
<?php
}
echo "</table>";
?>
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
you have your php code set up wrong. i tried putting to problem into words but couldn't. you have use the while statement incorrectly. i will provide the code to display the images right in alittle while. i can't right now because of my location. someone else might have a solution for you before the code is finished.
Last edited by kkeith29 : Oct 17th, 2007 at 11:12 am.
your code is totaly wrong.. u ve to while and for or for and for circle one after each other..
i wrote this one for someone ...few months ago...
it is originally set to 4 column right and 4 row down...
you can extend it as much as you want... but you have to clean it a bit...
i wrote this one for someone ...few months ago...
it is originally set to 4 column right and 4 row down...
you can extend it as much as you want... but you have to clean it a bit...
Last edited by fatihpiristine : Oct 17th, 2007 at 4:15 pm.
Do a favour, leave me alone
•
•
Join Date: Aug 2007
Posts: 181
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
how many rows and columns you want on the page?
what about size of the images ??
I need 7 columns and dynamic rows on the page, if pagination is possible then I need 7 columns and 4 rows per page...
Size of the image should be like thumbnail (about 150 x 150)
Thanks
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Generate Thumbnail images on the fly. (PHP)
- image gallery help (JavaScript / DHTML / AJAX)
- Free CMS (PHP)
- Dreamweaver Help (Site Layout and Usability)
- Forum Software (Existing Scripts)
- Hide all DIV's On Click (JavaScript / DHTML / AJAX)
- Flash - loaded swf image quality problems (Graphics and Multimedia)
- UploadHeaven.com...Free Image Host! (Post your Resume)
- Photo Gallery Control (ASP.NET)
Other Threads in the PHP Forum
- Previous Thread: Chat Program
- Next Thread: Web Browser throws an error 500


Linear Mode