Jump to content

[SOLVED] Help with while loop echo positions


SirChick

Recommended Posts

I have a while loop that im trying to echo infomation horizontally rather than downwards.

Downwards is pretty easy cos i just use </br> but i want to space the echo's out horizontally by X amount yet i cant use div's cos then they will be the same height rather than the second row of the while loop being below it.. this is what i tried:

 

$Getcars = mysql_query("SELECT * FROM cars
                    WHERE UserID='{$_SESSION['Current_User']}'")
			or die(mysql_error());	
                  
// Fetch the row from the database
if(mysql_num_rows($Getcars) != 0){	
echo'<div id="bv_" style="position:absolute;left:50px;top:450px;width:450px;height:22px;z-index:1" align="left">';
while($row = mysql_fetch_array($Getcars)) {
$CarName = $row['CarName'];
$FuelLeft = $row['FuelLeft'];
Echo'<font style="font-size:14px" color="#FFFFFF" face="Arial"><b>';echo$CarName;
Echo'            ';Echo$FuelLeft;

 

As you can see above i put a Echo'                  '; of open space but on the page it still comes up right next to car name like:

 

Car Name                              Fuel Left

Nissan       100

 

I need it to be like :

Car Name                              Fuel Left

Nissan                                  100

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.