I have a complex query. I paste some part of it below.
Code:
$query = "SELECT * FROM mytable WHERE Day LIKE '%$day%'";
-------------Day
Record1-----1234567
Record2-----67
Record3-----123
Record4-----4
Record5-----345
I set parameter
$day to get relevant records.
If i want some particular day, no problem, i set
But when i want to get all results wtihout looking to day value this query doesn't work.
What should i set to
$day variable or change "
LIKE" part which provides me to get records,
* when i search for particular day
* when the day is not an important criteria (get all records)
without changing the query for each option?
Thank you.