I am in the process of trying to fix this code. Whoever created it, disabled the advanced feature of my friends site. I am new to PHP and would appreciate any advice/help anyone can offer.
@FromU2MEDec 08.2005 — #If you want advanced search, you'll need to write the code yourself (apparently):
[code=php]if ($_GET[search_by] == "advanced_search") { $search_result = "Advance search is not available at this time, please try again later."; }[/code]
$sql = "SELECT * FROM $db_table WHERE plan_name LIKE '$_POST[plan_name]'"; $result = @mysql_query($sql, $link) or die (mysql_error());
$num_rows = mysql_num_rows($result);
if($num_rows == 0){ $search_result = "We didn't find any house plan with the name of $_POST[plan_name], but here are some house plans in the $_POST[plan_type] category."; $sql2 = "SELECT * FROM $db_table WHERE att_foyer LIKE '$_POST[plan_type]'"; $result2 = @mysql_query($sql2, $link) or die (mysql_error());
$num_rows = mysql_num_rows($result2); if($num_rows == 0){ $search_result = "We didn't find any house plan with the name of $_POST[plan_name], and there are no house plans in the $_POST[plan_type] category."; }
if($att_plan_type != $_POST[plan_type]){ $search_result = "We found $num_rows house plan(s) in our database, but it doesn't match the $_POST[plan_type] category "; } else { $search_result = "We found $num_rows house plan(s) in our database."; }