Skip to content

Instantly share code, notes, and snippets.

@thinkjson
Created September 10, 2012 12:22
Show Gist options
  • Select an option

  • Save thinkjson/3690630 to your computer and use it in GitHub Desktop.

Select an option

Save thinkjson/3690630 to your computer and use it in GitHub Desktop.
Getting double the ammount I should on value $v
$new_array = array();
$ret_html = "<table><tr><th>DMA</th><th>Leads</th></tr>";
while ($row = mysql_fetch_array($result))
foreach ($row as $key => $value) {
if (isset($new_array["$value"]))
$new_array["$value"]++;
else
$new_array["$value"]++;
#= 1;
}
foreach ($new_array as $k => $v) {
$ret_html .= "<tr><td>$k</td><td>$v</td></tr>";
}
return $ret_html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment