Forum Moderators: coopster
Then format the data to match the format used in your database and store as variable "$todaysdate"
Then simply query the database to display all users where DOB = $todaysdate.
Sorry if you wanted the actual code but its real easy if you already know how to query a database and display the results.
<?php require_once('Connections/connBlog.php');?>
<?php
$today= date("y-m-d");
echo $today;
?>
<?php
$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
mysql_select_db($database_connBlog, $connBlog);
$query_Recordset1 = "SELECT firstName FROM tbl_users WHERE birthday='$today'";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connBlog) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<table border="0">
<tr>
<td>username</td>
<td>birthday</td>
</tr>
<?php do {?>
<tr>
<td><?php echo $row_Recordset1['firstName'];?></td>
<td><?php echo $row_Recordset1['birthday'];?></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));?>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>
and finally i laughed at me because no one will have birthday on today date.My db DOB format is YYYY-MM-DD.I think ishouldnt consider year .I should only consider month and date and we have to match with db's DOB.Please suggest me how can i do like this.
$query_Recordset1 = "SELECT firstName FROM tbl_users WHERE MONTH(birthday) = MONTH(NOW() AND DAY(birthday) = DAY(NOW());