Got a question about a fairly simple query.
select fee from price where '$var' BETWEEN min AND max
Is there a reason why this is may not be wokring.
is this the output of
echo $sql;
or whatever your sql-statement is named?
if not please provide it to us
it seems like you are trying to compare a strring value with numeric values?
$var = 14; $sql = mysql_query("select fee from price where '$var' BETWEEN min AND max"); $value = mysql_fetch_assoc($sql); echo $value[fee];
Note min and max both contain numeric values.
$var = 14; $sql = mysql_query("select fee from price where $var BETWEEN min AND max"); $value = mysql_fetch_assoc($sql); echo $value[fee];
why not like this?
out of what reason do you have the ' in there?
That did it.
Is there a reason it doesn't wotk with '
Edit: it worked fine with ' on several other servers hence why i'm asking.