Forums
 This topic is locked 
             Horizontal Loop
 Posted 31 Jul 2001  18:28:45 
  1 
     has   voted 
  31 Jul 2001  18:28:45 Keith Slater posted: 
 I can get the horizontal loop to work but is tehir a way to use it so that it loops into different cells in a table? Right now the pictures are sitting right next to each other. but I'd like them to sit in TD cells right next to eachother then after 3 go down to a new TR.thanks again
Keith Slater
Word Pro Systems
www.wordprosys.com
Replies
 Replied 31 Jul 2001  19:52:41 
   31 Jul 2001  19:52:41 Tim Green replied: 
  You would have to manually code this. However it should be relatively easy as the code will be very similar to that of the Horizontal Looper code itself.
Your best bet would be to apply the Horizontal Looper, and then play around with the code.
Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
  Your best bet would be to apply the Horizontal Looper, and then play around with the code.
Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
 Replied 01 Aug 2001  20:15:46 
   01 Aug 2001  20:15:46 Keith Slater replied: 
  I've been messing with the code and I can't get nothing to happen. I realize it should be easy but I just can't get it...
Keith Slater
Word Pro Systems
www.wordprosys.com
  Keith Slater
Word Pro Systems
www.wordprosys.com
 Replied 01 Aug 2001  22:12:34 
   01 Aug 2001  22:12:34 Tim Green replied: 
  You should be looking for something in this kind of format :-
<table>
<?php while (!$Recordset->EOF) { ?>
<tr>
<?php for ($k=0; $k < 3; $k++) { ?>
<td><?php echo $Recordset->Fields("PICTURE"
; ?></td>
<?php
$Recordset->MoveNext();
}
?>
</tr>
<?php
}
?>
</table>
You will probably need to tweak this code a little, but I hope it puts you on the right track
Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
  <table>
<?php while (!$Recordset->EOF) { ?>
<tr>
<?php for ($k=0; $k < 3; $k++) { ?>
<td><?php echo $Recordset->Fields("PICTURE"
<?php
$Recordset->MoveNext();
}
?>
</tr>
<?php
}
?>
</table>
You will probably need to tweak this code a little, but I hope it puts you on the right track
Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
 Replied 09 Aug 2001  15:01:03 
   09 Aug 2001  15:01:03 Keith Slater replied: 
  this is the code I got now: 
table>
tr>
?php while (($Repeat1__numRows-- != 0) && (!$Recordset1->EOF))
{
?>
td width=173>
div align="center">a href="large.php?art=<?php echo $Recordset1->Fields("PICTURE_NAME"
?>">img src="images/<?php echo $Recordset1->Fields("PICTURE_NAME"
?>" width="150" height="150" border="0"></a><br>
a href="vprofile.php?artist=<?php echo $Recordset1->Fields("USER_NAME"
?>"> 
?php echo $Recordset1->Fields("ARTIST_NAME"
?>
</a></div>
</td>
?php
$Repeat1__index++;
$Recordset1->MoveNext();
}
?>
/tr>
/table>
I've been trying the ?php for ($k=0; $k <3; $k++){?>
and changing stuff around but I cant get it to work.
thanks for the help
Keith Slater
 
  table>
tr>
?php while (($Repeat1__numRows-- != 0) && (!$Recordset1->EOF))
{
?>
td width=173>
div align="center">a href="large.php?art=<?php echo $Recordset1->Fields("PICTURE_NAME"
a href="vprofile.php?artist=<?php echo $Recordset1->Fields("USER_NAME"
?php echo $Recordset1->Fields("ARTIST_NAME"
</a></div>
</td>
?php
$Repeat1__index++;
$Recordset1->MoveNext();
}
?>
/tr>
/table>
I've been trying the ?php for ($k=0; $k <3; $k++){?>
and changing stuff around but I cant get it to work.
thanks for the help
Keith Slater
 Replied 09 Aug 2001  16:42:30 
   09 Aug 2001  16:42:30 Tim Green replied: 
  OK. Please stick to this thread, the other thread will be locked to prevent confusion.
Try this code :-
<table border="0">
<?php while (($Repeat3__numRows-- != 0) && (!$Recordset3->EOF)) { ?>
<tr>
<td width="173">
<?php
$theLoop=0;
while (($theLoop < 3) && (!$Recordset3->EOF)) {
$theLoop++;
?>
<div align="center">
<img src="images/<?php echo $Recordset3->Fields("PICTURE_NAME"
?>" width="150" height="150"> 
<br>
<a href="vprofile.php?arist=<?php echo $Recordset3->Fields("USER_NAME"
?>"> 
<?php echo $Recordset3->Fields("ARTIST_NAME"
?>
</a>
</div>
<?php
$Recordset3->MoveNext();
}
?>
</td>
</tr>
<?php
$Repeat3__index++;
$Recordset3->MoveNext();
}
?>
</table>
I would recommend that you read through the PHP Manual (PDFs available at www.php.net) and learn about looping techniques.
Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
  Try this code :-
<table border="0">
<?php while (($Repeat3__numRows-- != 0) && (!$Recordset3->EOF)) { ?>
<tr>
<td width="173">
<?php
$theLoop=0;
while (($theLoop < 3) && (!$Recordset3->EOF)) {
$theLoop++;
?>
<div align="center">
<img src="images/<?php echo $Recordset3->Fields("PICTURE_NAME"
<br>
<a href="vprofile.php?arist=<?php echo $Recordset3->Fields("USER_NAME"
<?php echo $Recordset3->Fields("ARTIST_NAME"
</a>
</div>
<?php
$Recordset3->MoveNext();
}
?>
</td>
</tr>
<?php
$Repeat3__index++;
$Recordset3->MoveNext();
}
?>
</table>
I would recommend that you read through the PHP Manual (PDFs available at www.php.net) and learn about looping techniques.
Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
 Replied 09 Aug 2001  16:59:09 
   09 Aug 2001  16:59:09 Keith Slater replied: 
  thank you sooo much tim, it worked. I really appreciate it
Keith Slater
 
  Keith Slater
 Replied 09 Aug 2001  17:22:44 
   09 Aug 2001  17:22:44 Tim Green replied: 
  Glad I can be of help Keith ! <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
  Tim Green
Extension & PHP TalkZone Manager
<font size=1>-------------------------------------------
<i>Please read the Forum FAQ before posting
a question to this TalkZone.</i>
-------------------------------------------
www.UDzone.com : A dynamic Dreamweaver,
Ultradev and Fireworks site for developers
by developers.
-------------------------------------------</font id=size1>
