So I voted in the poll I made but the results haven’t changed, so…
The problem is either with the database, which does not receive the data I gave him;
or I just didn’t present the results correctly, so that the poll results are shown to the user as null (0) every time.
Here’s the code:
poll.php
[php]
POLL
"; echo ""; echo "Which browser are you using?
"; echo " Internet Explorer"; echo " Mozilla Firefox
"; echo " Google Chrome
"; echo ""; echo "see results"; echo ""; ?>
[/php]
results.php
[php]
POLL RESULTS
"; $queryt = mysql_query ("SELECT * FROM poll_table"); $arr = mysql_fetch_array($queryt); $all = $arr['a'] + $arr['b'] + $arr['c']; if ($all) { $a = $arr['a'] / $all; $b = $arr['b'] / $all; $c = $arr['c'] / $all; } else { $a = 0; $b = 0; $c = 0; } echo "Internet Explorer: " . $a . "%"; echo "Mozilla Firefox: " . $b . "%
"; echo "Google Chrome: " . $c . "%
"; ?>
[/php]
Help me Tell me what’s wrong with my code… I am novice at this…