Hello,
I have a table with a single column.
The column contains several rows.
Each field has a numeric value that I'll later use for statistical analysis.
| Values | id |
| 317 | 1 |
| 68 | 2 |
| 1142 | 3 |
The above is a sample table. I want to read the VALUES into an array, and make each value a variable that I can use independently. So far I've tried something like this, which failed:
...
$query = "select from vote";
$result = mysql_db_query($db,$query,$connection) or die("Error in query");
while ($myrow = mysql_fetch_array($result)) {
$opt1 = $myrow [0][1];
$opt2 = $myrow [0][2];
$opt3 = $myrow [0][3];
$added = $opt1 + $opt2 + $opt3 + $opt4;
//percentage of votes for option1
$centage1 = ($opt1100)/$added;
$centage2 = ($opt2100)/$added;
$centage3 = ($opt3100)/$added;
$centage4 = ($opt4*100)/$added;
...
Please help.
Richie.