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>";

}

}

 

?>

Link to comment
Share on other sites

<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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.