Need help with a form search, I have page with a form with list boxes when you hit submit, in theory it is to query the mysql database for the items pick on the search form. But I get this error.
Parse error: parse error, expecting `','' or `')'' in /users/web/blurent/web/results.php on line 5
my php code is:
<?php
$category_results1 = "%";
if (isset(#category#)) {
$category_results1 = (get_magic_quotes_gpc()) ? #category# : addslashes(#category#);
}
$state_results1 = "%";
if (isset(#state#)) {
$state_results1 = (get_magic_quotes_gpc()) ? #state# : addslashes(#state#);
}
$squarefeet_results1 = "%";
if (isset(#squarefeet#)) {
$squarefeet_results1 = (get_magic_quotes_gpc()) ? #squarefeet# : addslashes(#squarefeet#);
}
$rent_results1 = "%";
if (isset(#rent#)) {
$rent_results1 = (get_magic_quotes_gpc()) ? #rent# : addslashes(#rent#);
}
$bathrooms_results1 = "%";
if (isset(#bathrooms#)) {
$bathrooms_results1 = (get_magic_quotes_gpc()) ? #bathrooms# : addslashes(#bathrooms#);
}
$bedrooms_results1 = "%";
if (isset(#bedrooms#)) {
$bedrooms_results1 = (get_magic_quotes_gpc()) ? #bedrooms# : addslashes(#bedrooms#);
}
mysql_select_db($database_rentsurfing, $rentsurfing);
$query_results1 = sprintf("SELECT tblrentals.rentalID, tblrentals.%s, tblrentals.%s, tblrentals.MonthlyRent, tblrentals.%s, tblrentals.%s, tblrentals.Title FROM tblrentals WHERE tblrentals.%s LIKE '%s' AND tblrentals.%s LIKE '%s' AND tblrentals.%s LIKE '%s' AND tblrentals.MonthlyRent LIKE '%s' AND tblrentals.%s LIKE '%s' AND tblrentals.%s LIKE '%s'", $Bedrooms_results1,$Bathrooms_results1,$State_results1,$SquareFeet_results1,$Category_results1,$category_results1,$State_results1,$state_results1,$SquareFeet_results1,$squarefeet_results1,$rent_results1,$Bathrooms_results1,$bathrooms_results1,$Bedrooms_results1,$bedrooms_results1);
$results1 = mysql_query($query_results1, $rentsurfing) or die(mysql_error());
$row_results1 = mysql_fetch_assoc($results1);
$totalRows_results1 = mysql_num_rows($results1);
$rsrentals=$_POST['rsrentals'];?>
Parse error: parse error, expecting `','' or `')'' in /users/web/blurent/web/results.php on line 5
my php code is:
<?php
$category_results1 = "%";
if (isset(#category#)) {
$category_results1 = (get_magic_quotes_gpc()) ? #category# : addslashes(#category#);
}
$state_results1 = "%";
if (isset(#state#)) {
$state_results1 = (get_magic_quotes_gpc()) ? #state# : addslashes(#state#);
}
$squarefeet_results1 = "%";
if (isset(#squarefeet#)) {
$squarefeet_results1 = (get_magic_quotes_gpc()) ? #squarefeet# : addslashes(#squarefeet#);
}
$rent_results1 = "%";
if (isset(#rent#)) {
$rent_results1 = (get_magic_quotes_gpc()) ? #rent# : addslashes(#rent#);
}
$bathrooms_results1 = "%";
if (isset(#bathrooms#)) {
$bathrooms_results1 = (get_magic_quotes_gpc()) ? #bathrooms# : addslashes(#bathrooms#);
}
$bedrooms_results1 = "%";
if (isset(#bedrooms#)) {
$bedrooms_results1 = (get_magic_quotes_gpc()) ? #bedrooms# : addslashes(#bedrooms#);
}
mysql_select_db($database_rentsurfing, $rentsurfing);
$query_results1 = sprintf("SELECT tblrentals.rentalID, tblrentals.%s, tblrentals.%s, tblrentals.MonthlyRent, tblrentals.%s, tblrentals.%s, tblrentals.Title FROM tblrentals WHERE tblrentals.%s LIKE '%s' AND tblrentals.%s LIKE '%s' AND tblrentals.%s LIKE '%s' AND tblrentals.MonthlyRent LIKE '%s' AND tblrentals.%s LIKE '%s' AND tblrentals.%s LIKE '%s'", $Bedrooms_results1,$Bathrooms_results1,$State_results1,$SquareFeet_results1,$Category_results1,$category_results1,$State_results1,$state_results1,$SquareFeet_results1,$squarefeet_results1,$rent_results1,$Bathrooms_results1,$bathrooms_results1,$Bedrooms_results1,$bedrooms_results1);
$results1 = mysql_query($query_results1, $rentsurfing) or die(mysql_error());
$row_results1 = mysql_fetch_assoc($results1);
$totalRows_results1 = mysql_num_rows($results1);
$rsrentals=$_POST['rsrentals'];?>