Current location: Hot Scripts Forums » Programming Languages » PHP » Divide results into rows for a gallery


Divide results into rows for a gallery

Reply
  #1 (permalink)  
Old 05-27-04, 09:22 PM
mdhall's Avatar
mdhall mdhall is offline
Aspiring Coder
 
Join Date: Oct 2003
Posts: 510
Thanks: 1
Thanked 1 Time in 1 Post
Divide results into rows for a gallery

I havent found an image gallery yet that is quite what I want. I want to take the following query....

PHP Code:

$used = ("SELECT * FROM used_units LIMIT 9");
$result2=mysql_query($used);
$num2=mysql_num_rows($result2);
$i 0;
while (
$i $num):
$year=mysql_result($result2,$i,"year");
$model=mysql_result($result2,$i,"model");
$tag_line=mysql_result($result2,$i,"tag_line");
$photo=mysql_result($result2,$i,"photo"); 
$i++; 
endwhile; 
echo 
"<table border=\"1\" width=\"680\" cellpadding=\"2\" cellspacing=\"0\">
<tr>
<td width=\"700\" valign=\"middle\" align=\"center\">
<font face=\"verdana, times\" size=\"2\" color=\"#000000\">"
;
include(
"scale2.php");
echo 
"<br>
$year $division $model<br>$tag_line</font></td></table>"
...and create an image gallery with only nine pictures showing, 3 rows with 3 pictures in each row. I want the picture and its information together in the same "cell" and repeat that for each row of pictures. The pictures are in a folder named "used_units" and the pictures corresponding info is in the database, $photo being the pictures name. The scale2.php script limits the pictures display size.

I've tried different snippets of code for this, but can't get any tos et up correctly or display the way I want them to. Any suggestions on how to modufy this script?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to validate mutiple rows using the same input text Han84 JavaScript 1 08-02-07 09:14 AM
PHP, MySQL Beginner... Help Needed Displaying Results db3db3 PHP 1 05-12-04 01:24 AM
posting of results script Sir-ihlatrebon Script Requests 0 02-17-04 11:46 AM


All times are GMT -5. The time now is 10:36 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.