Hi,
I have a function that fetches a price from a database then is meant to do some maths and output the result but it just shows as 0. I have checked my query in phpmyadmin and all seems ok.
function getprice($part)
{
include 'dbconnect.php';
$result3 = mysql_query("SELECT * FROM price WHERE partno = '" . $part . "'");
$pid = mysql_fetch_array($result3);
$x = $pid['price'];
$y = 0.7;
$z = 1.2;
$sprice = ($x / $y) * $z;
return $sprice;
}
I am very new to php and just thought I would ask if i have done something wrong?
Thanks 🙂