Thanks for that. I do however have another question. Currently i'm using a SELECT SUM query to get the total sum a number of rows from a selected COLUMN.
Here's the code i'm using.
$sum = mysql_query("SELECT SUM(poll_results) FROM store_poll_options WHERE
poll_id = '$id'");
Now this works fine in phpmyadmin but when used in conjunction with the rest of my code it doesn't work as intended. Instead of returning the sum of the rows pertaining to that particular column it returns the total number of rows.
i.e.
I have 14 rows in a column, for that column i'd like all the rows with the same poll_id to be added together and returned as a total.
Note there are 6 rows with the same poll_id so they should be added together to give me one total.

Now here's the code used in phpmyadmin, you'll notice it returns a sum of 229 as that's the total of all the rows with identical a poll_id.

Now here's the code i'm using in conjuction withthe SELECT SUM query.
$sql = mysql_query("UPDATE store_poll_options SET poll_results = (poll_results +
0) WHERE poll_option_id = '$poll' ");
if (!$sql) {
echo 'Query failed: ', mysql_error();
}
$question = ("SELECT * FROM store_polls WHERE poll_id = '$id'");
$sql = mysql_query($question);
while ($row = mysql_fetch_assoc($sql))
{
$question = $row['poll_question'];
}
echo "$question<br><br>";
$results = mysql_query("SELECT poll_option_text, poll_results FROM store_poll_options
WHERE poll_id = '$id' ORDER BY poll_results DESC ");
if ($results)
while ($row = mysql_fetch_assoc($results))
//here's the SELECT SUM query {
$sum = mysql_query("SELECT SUM(poll_results) FROM store_poll_options WHERE poll_id =
'$id'");
$poll_result = $row['poll_results']/ $sum * 100;
$poll_option = $row['poll_option_text'];
echo"$poll_option<br>";
echo"$poll_result<br>";