Re: php search query
Posted: Wed Sep 25, 2013 11:39 am
Would I have to include multiple if statements and multiple select statements to make sure I am covered with all options, or would there be an easier way?
I.E.
I.E.
Code: Select all
if (empty($file))
{
SELECT COUNT(*) AS id FROM downloads WHERE name LIKE :file AND difficulty = :difficulty AND estates = :estates AND missions = :missions AND balanced = :balance AND category = :category
}
if (empty($author))
{
SELECT COUNT(*) AS id FROM downloads WHERE username LIKE :user AND difficulty = :difficulty AND estates = :estates AND missions = :missions AND balanced = :balance AND category = :category
}.etc.etc