clausowitz Posted July 8, 2011 Share Posted July 8, 2011 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 Quote Link to comment Share on other sites More sharing options...
AMcHarg Posted July 8, 2011 Share Posted July 8, 2011 Try in your <div> <div style="min-height: 100%"> Quote Link to comment Share on other sites More sharing options...
clausowitz Posted July 8, 2011 Author Share Posted July 8, 2011 Tried it both in the css file and in the div directly but doesn't change anything. Marco Quote Link to comment Share on other sites More sharing options...
clausowitz Posted July 9, 2011 Author Share Posted July 9, 2011 [sOLVED] I added some sentence after the calendar and now it makes the container big enough.[/sOLVED] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.