Pls see the code below, where i wanted to select all the records from my table where the submdate (submission date) is greater or equal to today's date. Whereas i have two or three records in my table which has this date greater than today but still then i get only one record displayed. I dont find any problem anywhere but still then i dont get the result displayed as i wanted. Pls help me where i have the problem.
Code:
<?php
global $database;
$today=date('Y-m-d', mktime());
$q = "SELECT * FROM tbltenderinfo where submdate>='".$today."'";
$result = $database->query($q);
$num_rows = mysql_numrows($result);
if(!$result || ($num_rows < 0)){
echo "Error displaying info";
return;
}
if($num_rows == 0){
echo "No tenders info available at present";
return;
}
for($i=0; $i<$num_rows; $i++){
$tenderID = mysql_result($result,$i,"tenderID");
$tenderdesc = mysql_result($result,$i,"tenderdesc");
$agency = mysql_result($result,$i,"agency");
$subdate = $session->formatdate(mysql_result($result,$i,"submdate")); ?>
<table class="tblstyle" align="right">
<tr>
<td class="thead">Sl #</td>
<td class="thead">Name of Work</td>
<td class="thead">Procuring Agency</td>
<td class="thead">Submission Date</td>
<td class="thead">Details</td>
</tr>
<tr>
<td height="27" class="details"><?php echo $i; ?></td>
<td class="details"><?php echo $tenderdesc; ?></td>
<td class="details"><?php echo $agency; ?></td>
<td class="details"><?php echo $subdate; ?></td>
<td class="details"><a href="moredetails.php?id=<?php echo $tenderID; ?>&&work=<?php echo $tenderdesc; ?>">More Details</a></td>
</tr>
</table>
<?php
}
?>
Comment