Sorry I didn't know how much info was necessary is this any better?
The Code:
--
-- Table structure for table `studiorota`
--
CREATE TABLE IF NOT EXISTS `studiorota` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`show` varchar(100) NOT NULL,
`date` date NOT NULL,
`starttime` time NOT NULL,
`endtime` time NOT NULL,
`volunteer1` int(11) NOT NULL,
`volunteer2` int(11) NOT NULL,
`volunteer3` int(11) NOT NULL,
`volunteer4` int(11) NOT NULL,
`removedate` int(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `volunteer2` (`volunteer2`),
KEY `volunteer3` (`volunteer3`),
KEY `volunteer4` (`volunteer4`),
KEY `volunteer1` (`volunteer1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `studiorota`
--
INSERT INTO `studiorota` (`id`, `show`, `date`, `starttime`, `endtime`, `volunteer1`, `volunteer2`, `volunteer3`, `volunteer4`, `removedate`) VALUES
(1, 'An Hour Of Fun', '2012-09-05', '17:00:00', '18:00:00', 1, 38, 48, 16, 1348763388),
(2, 'Talk', '2012-09-19', '10:00:00', '12:00:00', 19, 8, 53, 29, 1348763532);
mysql_query("SELECT TRUE FROM studiorota WHERE date='$_POST[date]' AND starttime <= '$_POST[timestart]' AND endtime > '$_POST[timeend]' ");
The problem is for example ID 1 the system must come back as TRUE when the user selects a start/end time between 1700 and 1800 although the query I already tried lets the user start at 1730 or end at 1730 clashing with ID 1.
As for SQL Injections and Data verification I can implement this when the query is fully working but any pointers? Hope this is clearer