I haven't a clue on how to write PHP but one of the sites I oversee uses it. I'd like to have a pie chart that automatically updates based on current data. I know how to write the HTML that will draw the chart but don't know how to get my MySQL statement to interact with the data. Here's the piece of code I want to run:
SELECT
pc.shortname Name,
Count(qa.factor) Count
FROM
stable_host pc,
stable_area pq,
stable_area_front qa
WHERE
pc.id = pq.host
AND pq.id = qa.area
AND ((pq.name='Signal1') OR (pq.name='Signal5'))
GROUP BY pc.shortname
ORDER BY pc.shortname
When I run this script, it gives me the following output:
Category1 62
Category2 53
Category3 35
Category4 38
My question is this: How do I get the output so it just shows the numbers, comma delimited? (Example: "62,53,35,38")