Wednesday, 14 August 2013

Basic error occuring in php

Basic error occuring in php

I have the following code that i want to query when location and price
range match to that in database. My code is:
$result = mysql_query("SELECT * FROM room_tb WHERE location ='{$location}'
AND (price between $_POST['minprice'] AND $_POST['maxprice'])")or
die('Could not connect: ' . mysql_error());
I have been getting this error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING
what have i done wrong?

No comments:

Post a Comment