[SOLVED] Query Help - Not getting the Records I expect
Posted: Mon Oct 25, 2004 12:54 pm
I'm helping a friend with their website. It's being hosted by a local company.
It is a PHP server, and mysql database -- I'm not sure if it's apache or IIS.
So anyway, I'm running the following query under a test dir on the website:
$query = "select * from CARS where PRICE<$PRICE and CRCAT='".$CRCAT."'";
I receive no errors, or warnings .. but it's returning all records - not those that are lower than the price.
I echo out the variable .. and this is it's value:
select * from CARS where PRICE<5000 and CRCAT='Used'
I get 'used' cars ..but I also get cars in price well over 5000.
PRICE is a bigint(5), and CRCAT is varchar(5)
Can anyone suggest anything that might help me fix this, and get the output I want?
Thank you...
~Lenn
It is a PHP server, and mysql database -- I'm not sure if it's apache or IIS.
So anyway, I'm running the following query under a test dir on the website:
$query = "select * from CARS where PRICE<$PRICE and CRCAT='".$CRCAT."'";
I receive no errors, or warnings .. but it's returning all records - not those that are lower than the price.
I echo out the variable .. and this is it's value:
select * from CARS where PRICE<5000 and CRCAT='Used'
I get 'used' cars ..but I also get cars in price well over 5000.
PRICE is a bigint(5), and CRCAT is varchar(5)
Can anyone suggest anything that might help me fix this, and get the output I want?
Thank you...
~Lenn