mrjameer Posted June 7, 2007 Share Posted June 7, 2007 hi, i have a mysql table with 3 fields 1.id 2.time 3.approved values 1 1181237691 0 2 1181237703 0 3 1181237711 0 i want to fetch the distinct dates from this timestamp values using select statement. i want to display like this 1 2007-06-07 second thing i want to update the approved value=1 where these distinct dates are equal to the above timestamps any of your help will be surely appreciated. thanks mrjameer Link to comment https://forums.phpfreaks.com/topic/54635-fetch-the-date-from-timestamp/ Share on other sites More sharing options...
per1os Posted June 7, 2007 Share Posted June 7, 2007 www.php.net/date www.php.net/strtotime $date = date('Y-m-d', $timefromdb); $dateto = "2007-06-07"; $datetocheck = strtotime($dateto); $sql = "UPDATE table_name SET value = 1 WHERE time = " . $datetocheck; Link to comment https://forums.phpfreaks.com/topic/54635-fetch-the-date-from-timestamp/#findComment-270182 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.