name|fileid|refferer|clicks|
good|same |asda.com|20 |
good|same |bsad.com|500 |
good|diffnt|csad.com|600 |
dddd|dasdds|asad.com|200 |
Output:
[asda.com,20],[bsda.com,500]
What I tried:
$result = mysql_query("SELECT * FROM `ios7_refclean`.`graph_refferer_table` WHERE Name = 'good'");
$rowz = mysql_fetch_assoc($result);
foreach ($rowz as $col => $value) {
if (($col !== "fileid") && ($col !== "name")) {
echo ",['" . $col . "'," . $value . "]";
}
However only one row of good is coming, the other rows are not coming. Also I am not able to link the $col of refferer with $value of clicks with square brackets.