Accessing MySql with PHP
Posted: Sat Jul 04, 2009 7:01 am
I have been scratching my head on this one. I have recently moved to a different web server. I have a simple page, pulling data from a table using a where condition. My condition doesn't seem to be working on the new server. I have made no changes to the code (except for the login and password to connect to the database). If I remove the condition it pulls all of the data fine. I am passing the variables ($price1 and $price2) in the url (http://www.......listing.php?price1=0&price2=100000). It worked perfectly on the old server. Any ideas what I may be doing wrong? The select statement is below --
Doesn't work:
$sql = "select * from listing_gah where price > '$price1' and price < '$price2' order by datesold DESC";
Works:
$sql = "select * from listing_gah order by datesold DESC";
PHP Version 5.2.9
MySQL Version 5
Thanks for any help!!
Doesn't work:
$sql = "select * from listing_gah where price > '$price1' and price < '$price2' order by datesold DESC";
Works:
$sql = "select * from listing_gah order by datesold DESC";
PHP Version 5.2.9
MySQL Version 5
Thanks for any help!!