Hi
Im trying to get a count from a field in my database, the field is called rating, in the field rating ,they could have 4 different ansewers very good,good, bad, very bad. im trying to get the count of very good , i have written some php code but does'nt work
here is the code i'm trying.
PHP Code:<?
$votes = mysql_query(" SELECT count( * ) as rating FROM vote WHERE rating= 'Very good' ");
}
if (!$votes) {
exit('<p>Error retrieving votes from database!<br />'.
'Error: ' . mysql_error(). '</p>');
}
while ($count = mysql_fetch_array($votes)) {
$rating = $count['Very good'];
?> Votes <strong>
<? $count = $_GET['Very good'];
echo"<div align=center>".$count['Very good']."</div>";
?>




Bookmarks