I have a php mysql query below that works great when all rows within the current day (-13-) in a date (05-13-2014):
$h = $time->igetDay();
$h = "%{$h}%";
$result = query("SELECT * FROM table_name WHERE table_column LIKE '%s'", $h);
print json_encode($result);
What I am trying to do now is get all the rows within a current week range. I created a function that returns an array of the 7 upcoming days as shown below:
$h = $time->igetWeekRange();
print_r($h);
//this displays: Array ( [0] => 13 [1] => 14 [2] => 15 [3] => 16 [4] => 17 [5] => 18
[6] => 19 [7] => 20 )
//I can also display the array like this:
Array ( [0] => -13- [1] => -14- [2] => -15- [3] => -16- [4] => -17- [5] => -18-
[6] => -19- [7] => -20- )
My problem is that I don't know how I would use the query:
$result = query("SELECT * FROM table_name WHERE table_column LIKE '%s'", $h);
In order to display all the rows that have the seven values of the array above.
What this query should do is display all the rows of the table that have a date within the next seven days of the current day. How can I do this? Let me know if there is anything else I could provide to help you understand better what I am trying to do.
Thanks in advance, any help would be greatly appreciated.