I have a serious problem dealing with data from MySQL. I insert the date upon form submission via php using NOW() and it is inserted into a table with field date. Upon retrieval from the db, I will like to subtract from a given say 10 hours, and once at zero a function is executed. But my conversion does not seem to work as I keep getting errors. Any help will be greatly appreciated. Thanks in advance!
code:
//retrieval from db
$sql = mysql_query("SELECT * FROM `objectives` LIMIT 0 , 30");
while ($data=mysql_fetch_array($sql))
{
$data['obj_date'];//2014-04-06
echo date('Y-d')- $data['obj_date'];//0
}