Jump to content

[SOLVED] Match Today's Date With Date in Database and Display Amount of Results


CloudSex13

Recommended Posts

Hey there -

 

For some reason, either I'm missing something in my code or I'm using a variable the wrong way, but it seems to return nothing back when echoing the results.

 

What I'm trying to accomplish is, to get all fields pertaining to a user's ID from the database, then match today's date with the deadline date in the database, and display the amount of results as a number.

 

My code is below:

 

$tasks = mysql_query("SELECT Deadline FROM Tasks WHERE AccountID='$AccountID' AND Status='1'");

while($gettasks = mysql_fetch_array($tasks)) {
$Deadline = $gettasks['Deadline'];

$altdate = date("Y-m-d");

while($altdate == $Deadline) {

$amountoftasks = mysql_num_rows($tasks);
$taskstoday = $amountoftasks + 1;

}

}

 

Anything help would be heavenly - I'm simply baffled, as for I am a self-taught PHP coder.

 

:P

 

Thank you if so.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.