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
Share on other sites

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.