jvrothjr Posted August 19, 2005 Share Posted August 19, 2005 $querystring .= " WHERE venuename LIKE '%$VT%'"; This will find any field the contains this value Quote Link to comment https://forums.phpfreaks.com/topic/2438-multifield-form-search/page/2/#findComment-8154 Share on other sites More sharing options...
olm75 Posted August 24, 2005 Author Share Posted August 24, 2005 y is my query not bringing results....not found...i want the viewers to search using 1 or any combination of fields..... [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--] $querystring = \"select * from venues\"; if ($VN != \"\" AND $AC == \"\" AND $AG == \"\") {$querystring .= \" where (venuename like \'%$VN%\')\";} if ($VN != \"\" AND $AC != \"\" AND $AG == \"\") {$querystring .= \" where (venuename like \'%$VN%\') AND (areacode like \'%$AC%\')\";} if ($VN != \"\" AND $AC == \"\" AND $AG != \"\") {$querystring .= \" where (venuename like \'%$VN%\') AND (agegroup like \'%$AG%\')\";} if ($VN == \"\" AND $AC != \"\" AND $AG == \"\") {$querystring .= \" where (areacode like \'%$AC%\')\";} if ($VN == \"\" AND $AC != \"\" AND $AG != \"\") {$querystring .= \" where (areacode like \'%$AC%\') AND (agegroup like \'%$AG%\')\";} if ($VN == \"\" AND $AC == \"\" AND $AG != \"\") {$querystring .= \" where (agegroup like \'%$AG%\')\";} if ($VN == \"\" AND $AC == \"\" AND $AG == \"\") {} [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] Quote Link to comment https://forums.phpfreaks.com/topic/2438-multifield-form-search/page/2/#findComment-8181 Share on other sites More sharing options...
jvrothjr Posted August 24, 2005 Share Posted August 24, 2005 [!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]$querystring = \"select * from venues\"; if ($VN != \"\" AND $AC == \"\" AND $AG == \"\") {$querystring = $querystring + \" where (venuename like \'%$VN%\')\";}[/span][!--PHP-Foot--][/div][!--PHP-EFoot--] Quote Link to comment https://forums.phpfreaks.com/topic/2438-multifield-form-search/page/2/#findComment-8182 Share on other sites More sharing options...
olm75 Posted August 27, 2005 Author Share Posted August 27, 2005 ok thanks, but do i just do that for all of the if statements or just that 1st one.... Quote Link to comment https://forums.phpfreaks.com/topic/2438-multifield-form-search/page/2/#findComment-8187 Share on other sites More sharing options...
jvrothjr Posted August 29, 2005 Share Posted August 29, 2005 ok thanks, but do i just do that for all of the if statements or just that 1st one.... 271773[/snapback] All Quote Link to comment https://forums.phpfreaks.com/topic/2438-multifield-form-search/page/2/#findComment-8200 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.