0) {
// output data of each row
while($row = mysqli_fetch_assoc($result)) {
$sex .= $row["yourSex"]. ",";
}
} else {
echo "0 results";
}
echo substr_count($sex,"M");
mysqli_close($conn);
?>
I need to take this data, just one column into a PHP variable
as comma separated values so I can read how many occurences of a
value are present and pass this information to my tables.
What I'm trying to achieve is counting how many occurences there
are in a column in my database and put them on a bar on my chart.
The 100% width of the chart area is to equal how many rows are in
the database and I've got PHP to retrieve the number of rows
sucessfully. Now I need to count how many occurences there are
in a column and divide this by the number of rows, times 100 and
I'll have the percentage the bar width needs to be.