use your php code to perform the following check --
if the user submits something, let's say the value 'foo', just plug it into the following WHERE clause
using an AND connector --
Code:
SELECT something
, anything
, just_not_the_dreaded_evil_select_star
FROM daTable
WHERE 1 = 1
AND somecolumn = 'foo'
but if the user's submission is empty, which means the user wants all rows, the use php to construct your query
without the AND condition --
Code:
SELECT something
, anything
, just_not_the_dreaded_evil_select_star
FROM daTable
WHERE 1 = 1
this will now return all rows
