Jump to content

show two ads from mysql in left and right


vinpkl

Recommended Posts

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 "<td>". "<img src='images/spacer.gif' width=15 height=2 />" . "</td>";

echo "</tr>";

}

}

 

?>

<style type="text/css">

.left { float:left; }

.right { float:right; }

</style>

 

<div class="left">image1</div> <div class="right">image2</div>

 

?

 

hi

 

where should i insert your code in my code. i m not calling image1 and image2 manually. these are called by loop in php code.  where can i write <div class="left"> and <div class="right">.

 

in my code :

echo "<td valign=top>". "<img height=200 width=253 src='admin/uploads/" . $row['offer_image'] . "'/>" . "</td>";

is calling both the images from same table column name "offer_image" from the mysql database.

 

please elaborate i m new to it

 

vineet

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.