User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Aug 2007
Posts: 181
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Image Gallery misdisplaying

  #1  
Oct 17th, 2007
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?

<?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&amp;id=$id\">Edit</a>"); ?></td>
            <td align="center"><?php print("<a href=\"admin.php?action=edit&amp;id=$id\">Edit</a>"); ?></td>
   <td align="center"><?php print("<a href=\"admin.php?action=edit&amp;id=$id\">Edit</a>"); ?></td>
            <td align="center"><?php print("<a href=\"admin.php?action=edit&amp;id=$id\">Edit</a>"); ?></td>
            <td align="center"><?php print("<a href=\"admin.php?action=edit&amp;id=$id\">Edit</a>"); ?></td>
   <td align="center"><?php print("<a href=\"admin.php?action=edit&amp;id=$id\">Edit</a>"); ?></td>
            <td align="center"><?php print("<a href=\"admin.php?action=edit&amp;id=$id\">Edit</a>"); ?></td>
        </tr>
  
  <tr>
            <td align="center"><?php print("<a href=\"admin.php?action=delete&amp;id=$id\">Delete</a>"); ?></td>  
            <td align="center"><?php print("<a href=\"admin.php?action=delete&amp;id=$id\">Delete</a>"); ?></td>
   <td align="center"><?php print("<a href=\"admin.php?action=delete&amp;id=$id\">Delete</a>"); ?></td>
            <td align="center"><?php print("<a href=\"admin.php?action=delete&amp;id=$id\">Delete</a>"); ?></td>
            <td align="center"><?php print("<a href=\"admin.php?action=delete&amp;id=$id\">Delete</a>"); ?></td>
   <td align="center"><?php print("<a href=\"admin.php?action=delete&amp;id=$id\">Delete</a>"); ?></td>
            <td align="center"><?php print("<a href=\"admin.php?action=delete&amp;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>";
    ?>
Attached Images
File Type: jpg gallery.JPG (83.3 KB, 7 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation: kkeith29 is on a distinguished road 
Rep Power: 3
Solved Threads: 72
kkeith29's Avatar
kkeith29 kkeith29 is online now Online
Practically a Master Poster

Re: Image Gallery misdisplaying

  #2  
Oct 17th, 2007
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.
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: Image Gallery misdisplaying

  #3  
Oct 17th, 2007
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...
Last edited by fatihpiristine : Oct 17th, 2007 at 4:15 pm.
Attached Files
File Type: zip RTL-Down.zip (1.1 KB, 8 views)
Do a favour, leave me alone
Reply With Quote  
Join Date: Aug 2007
Posts: 181
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Re: Image Gallery misdisplaying

  #4  
Oct 18th, 2007
Thanks much for the code, I will go through this and will post again...Thanks again
Reply With Quote  
Join Date: Aug 2007
Posts: 181
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Re: Image Gallery misdisplaying

  #5  
Oct 18th, 2007
Mr. fatihpiristine, Thanks much for the code,

I am not so expert in PHP, may I request you kindly, change the above attachment code "RTL-Down.zip" according to my problem, I know it is more expext, but request you...Thanks
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: Image Gallery misdisplaying

  #6  
Oct 18th, 2007
how many rows and columns you want on the page?
what about size of the images ??
Do a favour, leave me alone
Reply With Quote  
Join Date: Aug 2007
Posts: 181
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Re: Image Gallery misdisplaying

  #7  
Oct 19th, 2007
Originally Posted by fatihpiristine View Post
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
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:09 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC