jake2891 Posted September 9, 2008 Share Posted September 9, 2008 Hi guys, I have a form that im submitting and storing the data. What im having difficulty with is a label that I need displaying. if the date has been entered between 12.00 am and 15:59 pm then the label will be shown "new client" anything entered after 16:00 pm to 23.59pm the label wont be displayed today but should be displayed tomorrow instead. example code below. when i do the insert im using php's time() function for the date_added <?php $sql = "SELECT * FROM requirements"; $query = mysql_query($sql); $array = mysql_fetch_array($query); foreach($array as $a){ // something like // if $a['date_added'] put in today before 4pm display label else tomorrow it should display $label = 'New client'; } ?> Link to comment https://forums.phpfreaks.com/topic/123483-date-and-time-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.