If (isset($_POST['new_sched'])) {
session_start();
$therank = $_SESSION['gamerank'];
$thegender = $_SESSION['gamegender'];
$events=$_POST['event'];
foreach($events as $key1=>$value)
{
$all_events = "'".implode("','",array_values($value))."'";
}
$items = $_POST[datea];
foreach ($items as $val){
$datetime = strtotime($val[0].'/'.$val[1].'/'.$val[2].' '.$val[3].':'.$val[4].' '.$val[5]);
echo "<p>";
echo date("F j, Y, g:i a",$datetime);
echo "<p>";
$query = "INSERT INTO Results (Opponent,Notes,Site,Time,Gender,RankID) VALUES ($all_events,'$datetime','$thegender','$therank')";
echo "$query<br>";
}
}
A little more issues with my athletics scheduling program. This is processing the input from a multi line form.
I have a text box that is an input for a small note . So that if a game is a championship game or there is something special about it the user can type a note in that would display next to the game in the schedule.
What is happening is that if I have 5 games and I fill in notes for all of them then the above code will insert them into the query. but if there is only one note among the five nothing gets processed at all. I can prefill the text box with none or something so that it will process the notes when they are actually there. Then strip the none later. or is there away around this?
thanks
Tom