OK well I have a html seach box with 5 user inputs and then I want to seach for them in my mysql database. here is the code I have so far, but for the seachs with a combination of 2 variables I cant get it to work, just look at the code it will make more sence.
Any ideas?
Yours Thankfully
Ciaran Mc Cann
| Code: |
|
$byapplicantname = $_POST[byapplicantname]; $bybuildername = $_POST[bybuildername]; $bydevelopment_type = $_POST[development_type]; $bydescription_keywords = $_POST[description_keywords]; $bylocation = $_POST[bylocation]; $emtpy = ""; if(($bylocation == $emtpy)&($bydescription_keywords == $emtpy)) {} else {// Retrieve all the data from the table $result = mysql_query("SELECT * FROM PLANNING_APPLICATIONS WHERE DEVELOPMENT_LOCATION AND DEVELOPMENT_DESCRIPTION LIKE '%$bylocation%' AND '%$bydescription_keywords%' ") or die(mysql_error());}; ///////////////////////////////////////////////////////// if(($bylocation == $emtpy)&($bydevelopment_type == $emtpy)) {} else {// Retrieve all the data from the table $result = mysql_query("SELECT * FROM PLANNING_APPLICATIONS WHERE DEVELOPMENT_LOCATION AND DEVELOPMENT_TYPE LIKE '%$bylocation%' AND '%$$bydevelopment_type%' ") or die(mysql_error());}; /////////////////////////////////////////////////////////////// |
Any ideas?
Yours Thankfully
Ciaran Mc Cann
