Here is the whole thing:
http://pastebin.com/LNXXASL6
It's only concerned with the submit section for now. Basically I want to check for conflicts between assigning shows for certain times. Here is my attempt:
Frankly it isn't doing anything. I know the logic isnt spot on as it should only work for times inside other scheduled shows but this will do for now. The database uses TIME to store the starttime and endtime values. I collect the values from a user entry form like so:
Should these not both be in the same format now? Can anyone tell me why this isn't working
?
http://pastebin.com/LNXXASL6
It's only concerned with the submit section for now. Basically I want to check for conflicts between assigning shows for certain times. Here is my attempt:
Code:
$sql = "SELECT * FROM schedule WHERE starttime>='$starttime' AND endtime<='$endtime' AND day='$updateday'";
$result = mysqli_query($myconnection, $sql);
// Mysql_num_row is counting table row
$count = mysqli_num_rows($result);
if($count >=1)
{
$error_msg = '<font color="#FF0000">*A show is already scheduled during that time slot.</font>';
}
else
{
Frankly it isn't doing anything. I know the logic isnt spot on as it should only work for times inside other scheduled shows but this will do for now. The database uses TIME to store the starttime and endtime values. I collect the values from a user entry form like so:
Code:
$starttime = mysqli_real_escape_string($myconnection,$_POST['starttime']);
$endtime = mysqli_real_escape_string($myconnection,$_POST['endtime']);
$starttime = date($starttime, $timestamp);
$endtime = date($endtime, $timestamp);
Should these not both be in the same format now? Can anyone tell me why this isn't working

Last edited: