runnerjp Posted April 17, 2009 Share Posted April 17, 2009 ok i have got my form to enter tiem and date of a race <form name="f" method="POST"> <table cellpadding="0" cellspacing="0" border="0" bgcolor="#000000"><tr><td> <table cellpadding="4" cellspacing="1" border="0 "bgcolor="#FFFFFF"> <tr><td colspan="2" bgcolor="#000000"><font size="+1" color="#FFFFFF"><b>Add New Event</b></font></td></tr> <tr><td><b>Event Start Date: </b></td><td><input type="text" name="eventdate" value="" size="12"> <font size="2">mm/dd/yyyy</font></td></tr> <tr><td><b>Event Start: </b></td><td><input name="start" size="6"/><font size="2">00:00</font></td></tr> <tr><td><b>Event finish Date: </b></td><td><input type="text" name="eventdate" value="" size="12"> <font size="2">mm/dd/yyyy</font></td></tr> <tr><td><b>Event Finish: </b></td><td><input name="finish" size="6" /><font size="2">00:00</font></td></tr> <tr><td><b>Event:</b></td><td><input type="text" name="event" size="35" maxlength="128"></td></tr> <tr><td colspan="2" align="center" bgcolor="#CCCCCC"><input type="button" name="Submit" value="OK" onClick="javascript: formget2(this.form, 'http://www.runningprofiles.com/members/calendar/addevent.php');"> </td></tr> </table></td></tr></table></form> how can i add both the dates and time together using strtotime() ?? so then i can call from my db like this $iso_8601_date_time_string = date('Y-m-d', strtotime("April 17, 2009")); $sql = "SELECT e_id FROM events WHERE '$iso_8601_date_time_string' BETWEEN e_start AND e_end"; Link to comment https://forums.phpfreaks.com/topic/154512-solved-adding-date-and-time-together/ Share on other sites More sharing options...
laffin Posted April 17, 2009 Share Posted April 17, 2009 SELECT column_name(s) FROM table_name WHERE column_name BETWEEN value1 AND value2 $iso_date isnt a column and e_start and e_end arent values u got them mixed up My guess is u wud use WHERE e_start >= $iso_date AND e_end <= $iso_date Link to comment https://forums.phpfreaks.com/topic/154512-solved-adding-date-and-time-together/#findComment-812617 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.