start new row of pictures
Posted on
16th Feb 2014 07:03 pm by
admin
on my site www.budstreasureauctions.com there is a featured auctions box that users will pay to get there picture on the homepage. currently the box limit is 6. If you increase the limit then it will display the images in a row side by side continuously. I need it to display 6 per row then start a new row of 6, so on, so on.
here is the current code:
Code: <? $feature_sql="select * from featuredproducts f,auction_details p where p.status='Active' and selling_method!='ads' and selling_method!='want_it_now' and home_feature='yes' and picture1!='' and p.bid_starting_date <= NOW() and f.productid=p.productid order by rand() limit 6";
$feature_res=mysql_query($feature_sql);
$tot_count=mysql_num_rows($feature_res);
if($tot_count!=0)
{
?>
<table border="0" align="center" cellpadding="0" cellspacing="0" width=574>
<tr>
<td colspan=4 height="30" valign="middle">
<table width="574" cellpadding="0" cellspacing="0" >
<tr>
<tr class="tdhead"><td width="1%" height="30" valign="top"><img src=templates/<?=$tfold?>/img_files/h_left.gif></td>
<td width="98%" height="30" valign="middle"> <B>Featured Auctions</b> <a href="rssfeatured.php" target="_blank"><img src=templates/<? echo "$tfold" ?>/img_files/xml.gif border="0"></a></td>
<td width="1%" height="30" valign="top"><img src=templates/<?=$tfold?>/img_files/h_right.gif></td></tr>
</tr>
</table>
</tr></table>
<table border="0" align="center" cellpadding="0" cellspacing="0" width=574 class="ft_right">
<?
}
?>
<?
$count=0;
while($feature_row=mysql_fetch_array($feature_res))
{
$expire_date = $feature_row['expire_date'];
require 'ends.php';
$string_1=$feature_row[detailed_descrip];
$count=$count+1;
?>
<td valign=top>
<table cellpadding=5 cellspacing=2>
<td >
<? if(empty($feature_row['picture1']))
{ ?>
<table height="49" border="0" cellpadding=0 cellspacing=0>
<tr>
<td height="12" background="templates/<? echo "$tfold" ?>/img_files/window_01.gif" ></td>
</tr>
<tr>
<td background="templates/<? echo "$tfold" ?>/img_files/window_03.gif" >
<table border="0" cellpadding="0" cellspacing="0" width=77>
<tr valign="top">
<td align="center">
<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>">
<? echo $featured_row['producttitle']; ?>
<img src="templates/<? echo "$tfold" ?>/img_files/noimage2.gif" width=<?= $w; ?> height=<?=$h?> border=0>
</a>
</td>
</tr>
</table>
</td>
</tr><tr>
<?
$bid_sql="select * from site_bids where productid=".$feature_row['productid'];
$bid_res=mysql_query($bid_sql);
$bid_tot_row=mysql_num_rows($bid_res);
if($bid_tot_row!=0)
{
$bid_row=mysql_fetch_array($bid_res);
$curprice=$bid_row['bidding_amount'];
}
else
{
$curprice=$feature_row['min_bid_amount'];
}
if($feature_row['selling_method']=="fix")
{
$curprice=$feature_row['quick_buy_price'];
}
?>
<td valign=top align="center">
<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>">
<? echo $feature_row['producttitle'];?></a>
<? echo "Price: ".$feature_row['currency']." ".$curprice; ?>
<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>" style="text-decoration:none;">
<?= $string_difference; ?>
</a>
</td>
</tr>
</table>
<?
}
else
{
$img=$feature_row['picture1'];
list($width, $height, $type, $attr) = getimagesize("uploads/$img");
$h=$height;
$w=$width;
if($h>60)
{
$nh=60;
$nw=($w/$h)*$nh;
$h=$nh;
$w=$nw;
}
if($w>60)
{
$nw=60;
$nh=($h/$w)*$nw;
$h=$nh;
$w=$nw;
}
?>
<table height="49" border="0" cellpadding=0 cellspacing=0 align=center>
<tr>
<td height="12" ></td>
</tr>
<tr>
<td align=center>
<center>
<table border="1" cellpadding="0" cellspacing="0" width=65 height=65 bordercolor="#000000">
<tr valign="top">
<td align="center" bgcolor="#ffffff">
<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>">
<? echo $featured_row['producttitle']; ?>
<img src="uploads/<? echo $feature_row['picture1']; ?>" width=<?= $w; ?> height=<?=$h?> border=0>
</a>
</td>
</tr>
</table></center>
</td>
</tr>
<tr>
<?
$bid_sql="select * from site_bids where productid=".$feature_row['productid'];
$bid_res=mysql_query($bid_sql);
$bid_tot_row=mysql_num_rows($bid_res);
if($bid_tot_row!=0)
{
$bid_row=mysql_fetch_array($bid_res);
$curprice=$bid_row['bidding_amount'];
}
else
{
$curprice=$feature_row['min_bid_amount'];
}
if($feature_row['selling_method']=="fix")
{
$curprice=$feature_row['quick_buy_price'];
}
?>
<td valign=top align="center">
<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>">
<? echo $feature_row['producttitle'];?></a>
<? echo "Price: ".$feature_row['currency']." ".$curprice; ?>
<a href="itechd.php?productid=<? echo $feature_row['productid']; ?>" style="text-decoration:none;">
<?= $string_difference; ?>
</a>
</td></tr>
</table>
<?
}
?>
</td>
</tr>
</table>
</td> <?
}
?>
<? if($tot_count!=0)
{ ?>
</tr>
</table>
<?
}
?>
Your Answer:
Login to answer
170 49
Other forums
Help with Contact Form
I have this Form on an html page and the associated code on page.php (below).
I keep getting the
Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site
Calling All PHPFREAKS Blackberry Users
Are you a member of PHPFreaks and have a blackberry? Well RIM just recently released Blackberry Mes
how to easy edit text, with box? Help.
Hi.
I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy
Memory Allocation
Hi folks,
see this ex:
int v=5;
v=v+10;
then what will do the compiler before th
Multi image upload
I have a gallery to build and want to build a dynamic upload form to allow for $var number of fields
Redirect not working after making a POST/GET
Hi Everyone,
I am a novice in PHP. Here I have 2 pages, one page with a textbox and button an
Problem with an browser game.
Hello,i just joined that great forum and i got php prob,its kinda freaky...anyway i got browser game
Product categories for registration
Dear all,
We are going live with the Supplier registered next week. At standard, the 'sel
Logic question
im wondering what's the best method to do the above list:
it is for alliance @ MMORPG game