Jump to content

container not big enough


clausowitz

Recommended Posts

I display people who have their birthday in a so called container.

There was no problem with two people but now when there are more the container is not big enough.

Is there a way I can make sure that the result of the query always fit?

 

<?php if (isset($_SESSION['idx'])) {
echo '<div class="container" style="font-size:15px; margin-bottom:5px;"><p><strong>
Birthdays</strong></p>';
echo "$birthday_form";
echo '<p> </p><p> </p><p> </p>';
echo '</div><br />';}
?>

 

<?php
$day = date('d');
$month = date('m'); 
$week = date('d'+7);
$i = 0;

$sql = mysql_query("SELECT * FROM myMembers WHERE birthday <> ''"); // query the member

$birthday_form = '<table border="0" align="left" cellpadding="3"> ';
while($row = mysql_fetch_array($sql)){
$birthday_date = explode("-",$row["birthday"]);
$birthday_year = $birthday_date[0];
$birthday_day = $birthday_date[2];
    $birthday_month = $birthday_date[1];
$born = $row["birthday"];
$dayoftheweek = date('l', strtotime($born));
$MonthDiff = date("m") - $birthday_month;
    $DayDiff = date("d") - $birthday_day;
$YearDiff = date("Y") - $birthday_year;
if ($DayDiff < 0 || $MonthDiff < 0) {
          $YearDiff--; }

if (($birthday_day >= $day && $birthday_day <= $day+7) && $month == $birthday_month) {
	$i++;
	$UserID = $row["id"];
	$firstname = $row["firstname"];
	$lastname = $row["lastname"];
	$birthday_month = date( 'F', mktime(0, 0, 0, $birthday_month) );
	$birthday_form .= '<tr><td><a href="profile.php?id=' . $UserID . '" title="' . $firstname . ' ' . $lastname . '"><font color="#F00000">' . $firstname . ' ' . $lastname . '</font></a><br><font color="#999999">' . $dayoftheweek . ' ' . $birthday_day . ' ' . $birthday_month . ' - ' . $YearDiff . ' years old</font></td></tr>';
}  
}
if($i == 0) {
$birthday_form .= '<tr><td><font color="#999999">No birthdays this week.</font></td> ';
		}
$birthday_form .= '</tr></table> ';

?>

 

Marco

Link to comment
https://forums.phpfreaks.com/topic/241402-container-not-big-enough/
Share on other sites

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.