<?php /** * Получение представления таблицы mysql * автор: Nc_Soft * 31.08.09 */ $q = mysql_query("SELECT * FROM tbl"); $thead = false; echo '<table border="1">'; while (false !== $res=mysql_fetch_assoc($q)) { if ($thead === false) { $thead = true; echo '<tr>'; foreach (array_keys($res) as $v) { echo '<td>'.$v.'</td>'; } echo '</tr>'; } echo '<tr>'; foreach ($res as $ceil) { echo '<td>'.$ceil.'</td>'; } echo '</tr>'; } echo '</table>';