Jump to content

multifield form search


Recommended Posts

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--]

[!--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--]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.