Jump to content

Recommended Posts

i am having a css problem where i am trying to pull mutable records from the database but they wont display right. i need them to display vertically one under the next. atm there displaying kinda on top of each other

the css. thank you :)

.next_rideb{ width:200px;  border-style:groove; margin-left: 750px; margin-top:455px;
}

.next_ride{ width:200px; background-color:#FFF; border-style:groove; padding: 5px; position:absolute; 
}

 

The Php

<div class="nextrideb">
<?php

$dMonth = $_REQUEST["month"];
$dYear = $_REQUEST["year"];



  $data = mysql_query("SELECT * from main.mbadmin WHERE  mbadmin.month=$dMonth AND  mbadmin.year=$dYear  ORDER BY day DESC LIMIT 10;") or die(mysql_error());
//Puts it into an array 
while($info = mysql_fetch_array( $data )) 
{ 

Echo "<div class='next_ride'>";
Echo "Next Ride Updated On";
Echo "<br>";
echo $info['mk'] ;
echo "<hr>";
echo "<br>";
Echo $info['nextride'] ; 
Echo "<br>";
Echo "<hr>";
Echo "</div>";	

}
echo "<br>";
?>
</div>
<?php

Link to comment
https://forums.phpfreaks.com/topic/244361-php-and-css-help/
Share on other sites

That's because your using position absolute.

 

I recommend you output your items in a list for instance like so.

 

<?php
echo '<ul class="items">';
foreach($array as $value){

   echo '<li>'.$value.'</li>';
}
echo '</ul>';
?>

 

than in css you can style this list because you gave the UL a class of items.

for instance

 

.items{list-style:none;}

 

P.s. this is the wrong forum to fix php logic. This is just for fixing how it is being styled in css

Link to comment
https://forums.phpfreaks.com/topic/244361-php-and-css-help/#findComment-1255097
Share on other sites

  • 1 year later...
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.