PHP mySQL, how to get data from mysql for today ranging between 2 dates -


i have 2 columns in mysql table, valid_from & valid_till both have dates in them.

i want record today's date example if today 2016-04-22, , there record in table has valid_from & valid_till dates , today's date falls within range of record, want record.

my question how can that? thank you!

the image of table:

enter image description here

this way test if date, example today's date, id between valid_from date , valid_till date:

select * (table_name)  (date_to_test) > valid_from , (date_to_test) < valid_till; 

Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Java JSoup error fetching URL -

webstorm - PhpStorm file cache conflict with TypeScript compiler -