PHP Date Manipulate Help needed???
Posted: Sat Oct 11, 2003 9:25 am
Hi,
Is anyone can help me on this?
I'm writing a code and want to manipulate the date in php then store it to database.
My question:
I had set the database fields value as follow:
NextVisit date NOT NULL default '0000-00-00',
what I want is to update this fields with the value + 3 days from date is visited.
If today date is 2003-09-23, if student visit page today and then the system will automate update the NextVisit date with the value + 3 days, it means the date to update to the database would be 23+3 = 2003-09-26
see my code here:
$todaydate=".date("Y/m/d")."
$NextVisit= ???????? // here should be the day + 3 days, how the code will be? or any code needed before can get this date?
$query = "Update Atten SET NextVisit='$NextVisit' WHERE StudentID='$studenid'";
mysql_query($query) or die("Bad query: ".mysql_error());
Thanks for whoever will to help
Is anyone can help me on this?
I'm writing a code and want to manipulate the date in php then store it to database.
My question:
I had set the database fields value as follow:
NextVisit date NOT NULL default '0000-00-00',
what I want is to update this fields with the value + 3 days from date is visited.
If today date is 2003-09-23, if student visit page today and then the system will automate update the NextVisit date with the value + 3 days, it means the date to update to the database would be 23+3 = 2003-09-26
see my code here:
$todaydate=".date("Y/m/d")."
$NextVisit= ???????? // here should be the day + 3 days, how the code will be? or any code needed before can get this date?
$query = "Update Atten SET NextVisit='$NextVisit' WHERE StudentID='$studenid'";
mysql_query($query) or die("Bad query: ".mysql_error());
Thanks for whoever will to help