Code: Select all
$title = getrate ($sales,$transaction);
So I am calling this function getrate
and here is the code
Code: Select all
function getrate ($sale,$transaction)
{
$conn = mysql_connect ($mysql_host, $mysql_user, $mysql_password);
$sql = "SELECT Rate from Sheet1 where ((Lower <= $sale) AND (Upper >= $sale))";
$result = mysql_query ($sql, $conn);
$num=mysql_numrows($result);
$i=0;
while ($i < $num)
{
$title=mysql_result($result,$i,"Rate");
}
}
so the design of the Sheet1 table is like this
Code: Select all
id
Lower
Upper
Rate
so for example one of the record is saved like this
Code: Select all
3
15000
20000
125
but its not returning any value can someone tell me whats wrong in my code
thanks
toddd