sitNsmile
02-03-2010, 11:55 PM
Okay, I am trying to change my old rating with my new one. this time how I calculate top rated games is by how much people like it from dont like. so be is converted to a % in PHP, but how do I place that into a query?
my old query.
$sql_query = "SELECT * from games WHERE gamestatus = 1 ORDER BY rating DESC LIMIT 14";
this is the new rating, and I want to somehow do ORDER by highest %
$rate_yes = $row['rate_yes'];
$rate_no = $row['rate_no'];
$rate_t = $rate_yes + $rate_no;
$abcd = round($rate_yes / $rate_t * 100);
I making any sense, hope you can see what I'm trying to do.
Thanks
-Tim
my old query.
$sql_query = "SELECT * from games WHERE gamestatus = 1 ORDER BY rating DESC LIMIT 14";
this is the new rating, and I want to somehow do ORDER by highest %
$rate_yes = $row['rate_yes'];
$rate_no = $row['rate_no'];
$rate_t = $rate_yes + $rate_no;
$abcd = round($rate_yes / $rate_t * 100);
I making any sense, hope you can see what I'm trying to do.
Thanks
-Tim