<html> <head> <meta charset="UTF-8"> <title>Rate Movie</title> <script src="jquery.js" type="text/javascript"></script> <link rel="stylesheet" href="rating.css" /> <script type="text/javascript" src="rating.js"></script> </head> <body> <?php for ($i = 0; $i < count($ids); $i++) { //$rating_tableName = 'ratings'; $id = $ids[$i]; $disVotes_user = new Ratings(); $row = $disVotes_user->displayRating_user($id); if (!$row) { echo "<span style='color: red;'> Error! No record found in database!! </span>"; } /* while($row = $queryPre->fetch()) { $v = $row['total_votes']; $tv = $row['total_value']; $rat = $tv/$v; var_dump($rat); } */ $v = $row['total_votes']; $tv = $row['total_value'];