4
How not to register events in the time zone that is already registered ?
Example: I have an event in BD starting at 18:00 and ending at 22:00, I need that if the user tries to register a new event from 19:00 to 23:00 the system does not allow because it is in the already registered time range...
BD is with this structure: inicio - varchar(500) - example of registration "18:00" and end - varchar(500) - example of registration "22:00"
The Mysql Query for PHP 5.4:
$query = mysql_query("INSERT INTO compromiso (termino, inicio) VALUES ('$termino', '$inicio')") or die(mysql_error());
It would help if the column were
DATETIME
, have a chance to change?– bfavaretto
can I change! how is the time format ? 22:00:00 ?
– Alan PS
I actually think it would be better for TIME right ?
– Alan PS
If the tracks never cross overnight,
TIME
better yes.– bfavaretto
in fact they pass from one day to the next, but I have other fields with the day, month and year...
– Alan PS
Ever tried to use between with a select into?
– ptkato
@Patrick, set an example as an answer...
– Alan PS
I can’t, but take a look at that answer, it might help you: http://stackoverflow.com/a/3025332/3029543
– ptkato
Ah, avoid using it
mysql
, instead, usemysqli
.– ptkato