Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Results in Column

Status
Not open for further replies.

WilliamMute007

Programmer
Sep 30, 2007
116
GB
Can anyone please help if you can? Really appreciate it.

I have this prblem and its doing my head in. I have an SQL query which simply syuppose to return the result of a query in two columns using DIVs one on the left and one on the right.

Please see code:

Code:
while ($row = mysql_fetch_assoc($result)){
            ?>
<div id="latest">
	    			    <div class="product">
	    			    	<h4><? echo $row['firstname'];?></h4>
	    			    	<img src="images/<? echo $row['image'];?>" alt="" />
	    			    	<p><? echo $row['summary'];?></p>
	    			    	<p class="price">Price: <span>$29.95</span></p>
	    			    	<p><a href="consultant" class="more">Become a consultant</a> <a href="" class="add">Career Path</a></p>
	    			    </div>
  </div><!-- /latest -->                       
 

 <div id="best">
	    			
	    	            <div class="product">
	    			    	<h4><? echo $row['firstname'];?></h4>
	    			    	<img src="images/<? echo $row['image'];?>" alt="something" />
	    			    	<p><? echo $row['summary'];?></p>
	    			    	<p class="price">Price: <span>$29.95</span></p>
	    			    	<p><a href="consultant" class="more">Become a consultant</a> <a href="" class="add">Career Path</a></p>
	    			     </div>
                         
                                
	
   </div><!-- /best -->
			
	
<? } ?>

The problem is, it works fine, but everything is coming out on the left DIV only (<div id="best">)

Any suggestions?

Thanks in advance
 
Hi,

The clear both didnt work neither. Whats weired about this is, If I took out the while statement/php it works perfectly. Oh Well, never mind, I appreciate all your efforts!

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top