kawasaki Posted March 15, 2009 Share Posted March 15, 2009 I have made a calendar and made files to insert *EVENTS* on given dates. Right now i have it to insert on just a date format date(m - d - Y). What i am trying to figure out how to do is for a user to insert a STARTDATE and ENDDATE in a form and it will insert for all those dates. Maybe multiple entries with each date or a do a STARTDATE and Number of days staying, type deal. Does anyone have the answer of how to accomplish this? The code for adding i have is this if ( isset($_POST["submit"]) && !empty($event_desc)) { $eventyear = $_POST['eventyear']; $eventmonth = $_POST['eventmonth']; $eventdate = $_POST['eventdate']; $day_in_a_mth = date('t', mktime(0, 0, 0, $eventmonth, 1, $eventyear)) ; if ($day_in_a_mth >= $eventdate ) { $fulldate = $eventyear."-".$eventmonth."-".$eventdate; $event_desc = $_POST['event_desc']; $sql = "INSERT INTO event SET date='$fulldate', event_desc='$event_desc'"; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error()); //message( "ADD EVENT", "DATA ENTERED"); echo "Your Trout Shack Stay has been added to the calendar. Would you like to add more? <a href='caladd.php'>Add to Calendar<a>"; } else { message( "ERROR", "DATE ENTERED NOT VALID"); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.