Log in

View Full Version : display two ads images from mysql in left and right



vineet
10-20-2008, 03:37 PM
hi all

i want to display two offer ads images in my php page. i am able to fetch data from mysql in my page. But the trouble is the script below displays the data in rows like one ad image above and second ad image below.
i want to display one ad in left and second ad in its right. how is it possible.

vineet

<?php
$qry="select * from special_offers order by offer_id";
$result = mysql_query($qry);
if(mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
echo "<tr>";
echo "<td valign=top>". "<img height=200 width=253 src='admin/uploads/" . $row['offer_image'] . "'/>" . "</td>";
echo "</tr>";
}
}

?>

NXArmada
10-20-2008, 05:22 PM
try this



<?php
echo "<tr>";
$qry="select * from special_offers order by offer_id";
$result = mysql_query($qry);
if(mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
echo "<td valign=top>". "<img height=200 width=253 src='admin/uploads/" . $row['offer_image'] . "'/>" . "</td>";
}
}
echo "</tr>";
?>

vineet
10-21-2008, 03:08 AM
try this



<?php
echo "<tr>";
$qry="select * from special_offers order by offer_id";
$result = mysql_query($qry);
if(mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
echo "<td valign=top>". "<img height=200 width=253 src='admin/uploads/" . $row['offer_image'] . "'/>" . "</td>";
}
}
echo "</tr>";
?>


hi

thanks for the reply. it worked great.
one thing more i would like to ask you that if i want to add


echo "<td class=green_sep>". "<img src='images/spacer.gif' width=15 height=2 />" . "</td>";


this is code that inserts a separator between two ads then this code ads separator after first ad and also after second ad. but i want only one separator between. means i dont want separator inserted again after second ad.

vineet