Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse Error ????

Status
Not open for further replies.

bludot84

Programmer
Joined
Dec 16, 2004
Messages
4
Location
US
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'];?>
 
this is not coldfusion.

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
How should the Run-time value look like for php?
 
a form, ths is set up with drop-down list of Category, bedrooms, bathrooms, rent, and square feet.
 
depends on how the form is submitted.

If it's method is POST, You'd do something like this:

Code:
$value = isset($_POST['formfieldname']) ? $_POST['formfieldname'] : "default";

echo $value;

and for GET methods:

Code:
$value = isset($_GET['formfieldname']) ? $_GET['formfieldname'] : "default";

echo $value;

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top