twizler Posted May 6, 2006 Share Posted May 6, 2006 This code:[code]<html><head><title>Search Results!</title><?phprequire_once('system_errors.php');require_once('dbconnect.php');?></head><body><h1>Search Results</h1><?php$search_term = $_POST['search_term'];$lowend_price = $_POST['lowend_price'];$highend_price = $_POST['highend_price'];$city = $_POST['city'];$state = $_POST['state'];$look_in = $_POST['look_in'];$query = "select * from ".$look_in."";if ($look_in == "General_Needs"){ $look_again = "General"; }else if ($look_in == "Cars_Needs"){ $look_again = "Cars"; }else if ($look_in == "Housing_Needs"){ $look_again = "Home"; }if ($look_in == "".$look_again."_Needs" && $search_term && $highend_price && $lowend_price && $city && $state){ $query .= " where ".$look_again."_City like '%".$city."%' and ".$look_again."_State = '".$state."' and ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Price <= '".$highend_price."' and ".$look_again."_Title like '%".$search_term."%'";}else if ($look_in == "".$look_again."_Needs" && $search_term && !$lowend_price && !$highend_price && !$city && !$state){ $query .= " where ".$look_again."_Title like '%".$search_term."%'";}else if ($look_in == "".$look_again."_Needs" && $search_term && $lowend_price && !$highend_price && !$city && !$state){ $query .= " where ".$look_again."_Title like '%".$search_term."%' and ".$look_again."_Price = '".$lowend_price."'"; }else if ($look_in == "".$look_again."_Needs" && $search_term && $lowend_price && $highend_price && !$city && !$state){ $query .= " where ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Price <= '".$highend_price."' and ".$look_again."_Title like '%".$search_term."%'"; }else if ($look_in == "".$look_again."_Needs" && $search_term && $lowend_price && $highend_price && $city && !$state){ $query .= " where ".$look_again."_City like '%".$city."%' and ".$look_again."_Title like '%".$search_term."%' and ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Price <= '".$highend_price."'"; } else if ($look_in == "".$look_again."_Needs" && !$search_term && $lowend_price && !$highend_price && !$city && !$state){ $query .= "where ".$look_again."_Price = '".$lowend_price."'"; } else if ($look_in == "".$look_again."_Needs" && !$search_term && $lowend_price && $highend_price && !$city && !$state){ $query .= " where ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Price <= '".$highend_price."'";}else if ($look_in == "".$look_again."_Needs" && !$search_term && $lowend_price && $highend_price && $city && !$state){ $query .= " where ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Price <= '".$highend_price."' and ".$look_again."_City like '%".$city."%'"; } else if ($look_in == "".$look_again."_Needs" && !$search_term && $lowend_price && $highend_price && $city && $state){ $query .= " where ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Price <= '".$highend_price."' and ".$look_again."_City like '%".$city."%' and ".$look_again."_State = '".$state."'"; } else if ($look_in == "".$look_again."_Needs" && !$search_term && !$lowend_price && $highend_price && !$city && !$state){ $query .= " where ".$look_again."_Price = '".$highend_price."'";}else if ($look_in == "".$look_again."_Needs" && $search_term && !$lowend_price && $highend_price && !$city && !$state){ $query .= " where ".$look_again."_Title like '%".$search_term."%' and ".$look_again."_Price = '".$highend_price."'";}else if ($look_in == "".$look_again."_Needs" && $search_term && $lowend_price && $highend_price && !$city && !$state){ $query .= " where ".$look_again."_Title like '%".$search_term."%' and ".$look_again."_Price <= '".$highend_price."' and ".$look_again."_Price >= '".$lowend_price."'";}else if ($look_in == "".$look_again."_Needs" && $search_term && $lowend_price && $highend_price && $city && !$state){ $query .= " where ".$look_again."_Title like '%".$search_term."%' and ".$look_again."_Price <= '".$highend_price."' and ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_City like '%".$city."%'";}else if ($look_in == "".$look_again."_Needs" && !$search_term && !$lowend_price && !$highend_price && $city && !$state){ $query .= " where ".$look_again."_City like '%".$city."%'";}else if ($look_in == "".$look_again."_Needs" && $search_term && !$lowend_price && !$highend_price && $city && !$state){ $query .= " where ".$look_again."_Title like '%".$search_term."%' and ".$look_again."_City like '%".$city."%'";}else if ($look_in == "".$look_again."_Needs" && $search_term && $lowend_price && !$highend_price && $city && !$state){ $query .= " where ".$look_again."_Title like '%".$search_term."%' and ".$look_again."_Price = '".$lowend_price."' and ".$look_again."_City like '%".$city."%'";}else if ($look_in == "".$look_again."_Needs" && $search_term && $highend_price && $lowend_price && $city && !$state){ $query .= " where ".$look_again."_City like '%".$city."%' and ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Price <= '".$highend_price."' and ".$look_again."_Title like '%".$search_term."%'";}else if ($look_in == "".$look_again."_Needs" && !$search_term && !$highend_price && !$lowend_price && !$city && $state){ $query .= " where ".$look_again."_State = '".$state."'";}else if ($look_in == "".$look_again."_Needs" && $search_term && !$highend_price && !$lowend_price && !$city && $state){ $query .= " where ".$look_again."_State = '".$state."' and ".$look_again."_Title like '%".$search_term."%'";}else if ($look_in == "".$look_again."_Needs" && $search_term && $highend_price && !$lowend_price && !$city && $state){ $query .= " where ".$look_again."_State = '".$state."' and ".$look_again."_Price = '".$highend_price."' and ".$look_again."_Title like '%".$search_term."%'";}else if ($look_in == "".$look_again."_Needs" && $search_term && $highend_price && $lowend_price && !$city && $state){ $query .= " where ".$look_again."_State = '".$state."' and ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Price <= '".$highend_price."' and ".$look_again."_Title like '%".$search_term."%'";}else if ($look_in == "".$look_again."_Needs" && !$search_term && !$highend_price && !$lowend_price && $city && $state){ $query .= " where ".$look_again."_City like '%".$city."%' and ".$look_again."_State = '".$state."'";}else if ($look_in == "".$look_again."_Needs" && !$search_term && $highend_price && $lowend_price && !$city && $state){ $query .= " where ".$look_again."_State = '".$state."' and ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Price <= '".$highend_price."'";}else if ($look_in == "".$look_again."_Needs" && !$search_term && !$highend_price && !$lowend_price && !$city && !$state){ $query = "Select * from ".$look_in."";}else if ($look_in == "".$look_again."_Needs" && !$search_term && $highend_price && !$lowend_price && !$city && $state){ $query .= " where ".$look_again."_State = '".$state."' and ".$look_again."_Price <= '".$highend_price."'";}else if ($look_in == "".$look_again."_Needs" && !$search_term && !$highend_price && $lowend_price && !$city && $state){ $query .= " where ".$look_again."_State = '".$state."' and ".$look_again."_Price >= '".$lowend_price."'";}else if ($look_in == "".$look_again."_Needs" && $search_term && $highend_price && !$lowend_price && $city && $state){ $query .= " where ".$look_again."_City like '%".$city."%' and ".$look_again."_State = '".$state."' and ".$look_again."_Price <= '".$highend_price."' and ".$look_again."_Title like '%".$search_term."%'";}else if ($look_in == "".$look_again."_Needs" && $search_term && !$highend_price && $lowend_price && $city && $state){ $query .= " where ".$look_again."_City like '%".$city."%' and ".$look_again."_State = '".$state."' and ".$look_again."_Price >= '".$lowend_price."' and ".$look_again."_Title like '%".$search_term."%'";}else if ($look_in == "".$look_again."_Needs" && $search_term && !$highend_price && !$lowend_price && $city && $state){ $query .= " where ".$look_again."_City like '%".$city."%' and ".$look_again."_State = '".$state."' and ".$look_again."_Title like '%".$search_term."%'";}$result = mysql_query($query) or die();while ($row = mysql_fetch_assoc($result)){ if ($look_in == "General_Needs") { echo $row['General_Title']; echo $row['General_City']; echo $row['General_State']; echo $row['General_Price']; echo $row['General_Desc']; } else if ($look_in == "Cars_Needs") { echo $row['Cars_Title']; echo $row['Cars_Make']; echo $row['Cars_Year']; echo $row['Cars_Color']; echo $row['Cars_Price']; echo $row['Cars_City']; echo $row['Cars_State']; echo $row['Cars_Desc']; } else if ($look_in == "Housing_Needs") ( echo $row['Home_Title']; echo $row['Home_Beds']; echo $row['Home_Pets']; echo $row['Home_Own_Rent']; echo $row['Home_Price']; echo $row['Home_City']; echo $row['Home_State']; echo $row['Home_Desc']; }}?></body></html>[/code] is giving me this error: Parse error: syntax error, unexpected T_ECHO in /home/u2/kabbash615/html/ineedblank/Search_Results.php on line 219Why?I have done some research on the error and everyone says its a missing ; or a tag I opened and didnt end but I cannot find it... Please help! Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 6, 2006 Share Posted May 6, 2006 Please post lines 215-220 for us. Quote Link to comment Share on other sites More sharing options...
twizler Posted May 6, 2006 Author Share Posted May 6, 2006 215: echo $row['Cars_State'];216: echo $row['Cars_Desc'];217: }218: 219: else if ($look_in == "Housing_Needs")220: (While posting that I discovered one error: I had a ( instead of a { after housing needs... But i am still getting the same error Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 6, 2006 Share Posted May 6, 2006 Shouldn't 220 be { not ( Quote Link to comment Share on other sites More sharing options...
twizler Posted May 6, 2006 Author Share Posted May 6, 2006 Yea while posting I discovered that error... But I am still getting back the same error message, same line and everything... Quote Link to comment Share on other sites More sharing options...
twizler Posted May 6, 2006 Author Share Posted May 6, 2006 Anyone have any ideas why I am still getting this error?! Quote Link to comment Share on other sites More sharing options...
neylitalo Posted May 6, 2006 Share Posted May 6, 2006 I'm assuming you've uploaded the file with the { instead of the ( in it? Quote Link to comment Share on other sites More sharing options...
darga333 Posted May 7, 2006 Share Posted May 7, 2006 on line 219 try to put "elseif" instead of "else if"does that work? Quote Link to comment Share on other sites More sharing options...
twizler Posted May 8, 2006 Author Share Posted May 8, 2006 I figured out my problem incase anyone was wondering for learning experiance.. Dreamweaver was not updating my files remote. Thanks for the help everyone! Quote Link to comment 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.