[PHP-DB] How to get 2 columns to display

2004-12-06 Thread Aaron Wolski
Hi guys,

I'm trying to get two columns of td/td to display side by side and
then go to a new row. I am using this code but nothing I seem to do is
working this far. 

?php
for ($r=0;$products = db_fetch($productsQuery);$r++)
{
?
  td align=centera href=?php echo $base_url; ?products/?php
echo $category; ?/?php echo $products['name_url']; ?
class=product_linkimg src=?php echo $base_url;
?product_images/thumbs/?php echo $products['thumb']; ? border=0
width=159br?php echo $products['name']; ?/a/td
?php
 if ((($r+1) % 2) == 0)
 {  
?
/tr
tr valign=top
?php
 }
}
?

What is happening with this code is I am getting results like:

tr
tdIMAGE HERE/td
tdIMAGE HERE/td
tdIMAGE HERE/td
tdIMAGE HERE/td
tdIMAGE HERE/td
/tr

What I WANT is:

tr
tdIMAGE HERE/td
tdIMAGE HERE/td
/tr
tdIMAGE HERE/td
tdIMAGE HERE/td
/tr
tdIMAGE HERE/td
td/td
/tr

ANY clue where I am going wrong?

Thanks so much.

Aaron

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] How to get 2 columns to display

2004-12-06 Thread Bastien Koert
try this
?php
for ($r=0;$products = db_fetch($productsQuery);$r++)
{
if (($r % 2) == 0)
 {
echo /tr
tr valign=\top\;
 }
 echo td align=\center\
 			a href=.$base_url.products/.$category./.$products['name_url']
		class=product_linkimg 
src=.$base_url.product_images/thumbs/.$products['thumb'] border=0
		width=\159\br.$products['name']./a/td;

}
?

bastien

From: Aaron Wolski [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] How to get 2 columns to display
Date: Mon, 6 Dec 2004 08:43:21 -0500
Hi guys,
I'm trying to get two columns of td/td to display side by side and
then go to a new row. I am using this code but nothing I seem to do is
working this far.
?php
for ($r=0;$products = db_fetch($productsQuery);$r++)
{
?
  td align=centera href=?php echo $base_url; ?products/?php
echo $category; ?/?php echo $products['name_url']; ?
class=product_linkimg src=?php echo $base_url;
?product_images/thumbs/?php echo $products['thumb']; ? border=0
width=159br?php echo $products['name']; ?/a/td
?php
 if ((($r+1) % 2) == 0)
 {
?
/tr
tr valign=top
?php
 }
}
?
What is happening with this code is I am getting results like:
tr
tdIMAGE HERE/td
tdIMAGE HERE/td
tdIMAGE HERE/td
tdIMAGE HERE/td
tdIMAGE HERE/td
/tr
What I WANT is:
tr
tdIMAGE HERE/td
tdIMAGE HERE/td
/tr
tdIMAGE HERE/td
tdIMAGE HERE/td
/tr
tdIMAGE HERE/td
td/td
/tr
ANY clue where I am going wrong?
Thanks so much.
Aaron
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php