vinpkl Posted October 20, 2008 Share Posted October 20, 2008 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>"; } } ?> Quote Link to comment Share on other sites More sharing options...
swamp Posted October 20, 2008 Share Posted October 20, 2008 <style type="text/css"> .left { float:left; } .right { float:right; } </style> <div class="left">image1</div> <div class="right">image2</div> ? Quote Link to comment Share on other sites More sharing options...
vinpkl Posted October 20, 2008 Author Share Posted October 20, 2008 <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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.