Hey there
I almost had it working.
The problem is I can only output 2 dates.
global $i;
global $k;
$i = 0;
$k = 0;
while($row = mysqli_fetch_array($result))
{
$now = date("l jS F Y");
$date = $row['Date'];
$time = date("l jS F Y", $date);
if($now == $time and $i==0)
{
global $i;
echo "<h1>" . $time . "</h1>";
echo "<table border='1' width='1000'>
<tr>
<th>ID</th>
<th>Name</th>
<th>Book</th>
<th>Subject</th>
<th>Price</th>
<th>Description</th>
<th>Picture</th>
</tr>";
echo "<tr>";
echo '<td><a class="top" href="DetailPage.php?ID=' . $row["ID"];
echo '">' . $row['ID'] . '</a></td>';
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['book'] . "</td>";
echo "<td>" . $row['subject'] . "</td>";
echo "<td>" . $row['Price'] . "</td>";
echo "<td>" . $row['Description'] . "</td>";
echo "<td>" . "<img src=\"" . $row['picname'] . "\" width=100 height=100 />" . "</td>";
echo "</tr>";
echo "</table>";
$i =1;
}
elseif($now == $time and $i!=0)
{
echo "<table border='1' width='1000'>
<tr>
<th>ID</th>
<th>Name</th>
<th>Book</th>
<th>Subject</th>
<th>Price</th>
<th>Description</th>
<th>Picture</th>
</tr>";
echo "<tr>";
echo '<td><a class="top" href="DetailPage.php?ID=' . $row["ID"];
echo '">' . $row['ID'] . '</a></td>';
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['book'] . "</td>";
echo "<td>" . $row['subject'] . "</td>";
echo "<td>" . $row['Price'] . "</td>";
echo "<td>" . $row['Description'] . "</td>";
echo "<td>" . "<img src=\"" . $row['picname'] . "\" width=100 height=100 />" . "</td>";
echo "</tr>";
echo "</table>";
}
elseif($now != $time)
{
if($k == 0)
{
echo "<h1>" . $time . "</h1>";
echo "<table border='1' width='1000'>
<tr>
<th>ID</th>
<th>Name</th>
<th>Book</th>
<th>Subject</th>
<th>Price</th>
<th>Description</th>
<th>Picture</th>
</tr>";
echo "<tr>";
echo '<td><a class="top" href="DetailPage.php?ID=' . $row["ID"];
echo '">' . $row['ID'] . '</a></td>';
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['book'] . "</td>";
echo "<td>" . $row['subject'] . "</td>";
echo "<td>" . $row['Price'] . "</td>";
echo "<td>" . $row['Description'] . "</td>";
echo "<td>" . "<img src=\"" . $row['picname'] . "\" width=100 height=100 />" . "</td>";
echo "</tr>";
echo "</table>";
$k =1;
}
elseif($k != 0)
{
echo "<table border='1' width='1000'>
<tr>
<th>ID</th>
<th>Name</th>
<th>Book</th>
<th>Subject</th>
<th>Price</th>
<th>Description</th>
<th>Picture</th>
</tr>";
echo "<tr>";
echo '<td><a class="top" href="DetailPage.php?ID=' . $row["ID"];
echo '">' . $row['ID'] . '</a></td>';
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['book'] . "</td>";
echo "<td>" . $row['subject'] . "</td>";
echo "<td>" . $row['Price'] . "</td>";
echo "<td>" . $row['Description'] . "</td>";
echo "<td>" . "<img src=\"" . $row['picname'] . "\" width=100 height=100 />" . "</td>";
echo "</tr>";
echo "</table>";
$now = $row['Date'];
}
}
}
How can one change the code so that the current date is shown and links are displayed underneath?
Like:
Thursday, Apr. 24...
Bike for sale
Car for sale
Motorcycle for sale
Wednesday, Apr. 23...
[COLOR="#))))FF"]Bike for sale[/color]