seria algo como :
Código PHP:
Ver original
$resultSet = mysql_query("SELECT * FROM mitabla LIMIT 0,1");
{
}
{
$comparacion = "";//tu valor
$html = '<table border=1px>';
$html .= '<tr><td>CAMPO </td><td>VALOR</td></tr>';
foreach($campos as $camp)
{
$query = sprintf("SELECT (%s) AS total FROM mitabla WHERE %s = '%s' ",$camp,$camp,$comparacion);
{
$html .= '<tr><td>'.$camp.'</td> <td>'.$row["total"].'</td></tr>';
}
};//fin foreach
$html .= '</table>';
echo $html;
}
lo hice ahi rapido; posiblemente alla algun error de sintaxis...espero te haya entendido