3
I made the code below and it works, the check indicates whether the date is contained between the two columns and returns the result.:
SELECT * FROM `ips_bloqueados`
WHERE ip = '::1' AND '2015-04-18' BETWEEN date(inicio) AND date(fim)
However I would like to implement for Date and Time, I want to return if the date and time is contained between the two columns, but I’m not getting, the code does not return any results, but was to return:
SELECT * FROM `ips_bloqueados`
WHERE ip = '::1' AND '2015-04-18 14:10:00' BETWEEN date(inicio) AND date(fim)
Code Above Returns 0 Found Records.
But look at the database structure:
id_bloqueio ip inicio fim
20 '::1' '2015-04-19 14:02:42' '2015-04-19 14:17:42'
19 '::1' '2015-04-18 14:02:27' '2015-04-18 14:17:27'
18 '::1' '2015-04-18 14:02:19' '2015-04-18 14:17:19'
17 '::1' '2015-04-18 14:01:47' '2015-04-18 14:16:47'
16 '::1' '2015-04-18 14:01:46' '2015-04-18 14:16:46'
Instead of the link to download the bank it would be better to put, in question, half a dozen table rows.
– ramaral
No problem Al, I made the suggested edition, now you can help me ?
– Danilo Ramon