Answer the question
In order to leave comments, you need to log in
How to search by date in sql?
There is such a table: id, title, dates_list
dates_list of type text and the data in it is stored as a string 2015-11-20|0,2016-01-03|1,2016-01-14|0
date | accessibility
How, with such a structure of data storage, can you organize a search by a range of dates in order to be able to page-by-page navigation through the search results?
Answer the question
In order to leave comments, you need to log in
Normal - nothing.
Normalize the database, take out this data in a separate linked table.
$is_available = 1;
$sql_query = "SELECT * FROM table WHERE dates_list LIKE '%2015-11-20|{$is_available}%' OR dates_list LIKE '%2016-01-03|{$is_available}%' OR ..."
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question