<?php
$current_date = strtotime('now');
$due_end_date = 60*60*24*7; // Number of seconds for 7 days
$sql = "SELECT * FROM sre_log WHERE current_date >== '$due_end_date-$current_date' ORDER by vtype";
$due_end_date = mysql_query($sql);
//echo "$current_date";
while($a < $sre_log_num)
{
$id = mysql_result($sre_log_result,$a,"id");
$vtype = mysql_result($sre_log_result,$a,"vtype");
$due_end_date = mysql_result($sre_log_result,$a,"due_end_date");
$current_date = mysql_result($sre_log_result,$a,"current_date");
}
echo "$due_end_date";
echo "$current_date";
echo "$vtype";
$a++;
// If the previous article has a different day than this article then place this header
if ($current_date != $due_end_date)
{
echo "<h3 class=\"update\">";
echo "<em>There are no reminders for vehicle $vreg</em>";
echo "<em style=\"font-size:12px; float:right;\">Next Service Dued $vreg[$due_end_date]</em>";
echo "</h3>";
}
elseif ($current_date == $due_end_date)
{
// Put the details of each vehicle here.
echo "<div>'$last_startdate'[Last_Service_Done]</div>";
echo "<div>'$vreg'[Next_Service_Due: $due_end_date]</div>";
}
?>
accra
1
Junior Poster in Training
Recommended Answers
Jump to PostYou forgot to add what part is not working well. It appears this is not the complete code, as there is no
mysql_connect
in this snippet.
Jump to PostYou can format your date with the
date()
function. What is the column type for your date columns ?
All 7 Replies
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
accra
1
Junior Poster in Training
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
accra
1
Junior Poster in Training
pritaeas
2,194
¯\_(ツ)_/¯
Moderator
Featured Poster
accra
1
Junior Poster in Training
reco21
4
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.