var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: LIKE or relevant option to get results without changing query
I have a complex query. I paste some part of it below.
$query = "SELECT * FROM mytable WHERE Day LIKE '%$day%'";
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?
empty string then the query resolves to
that should return all rows
SELECT * FROM mytable WHERE Day LIKE '%%'
assuming Day is VARCHAR
Tags for this Thread