Este codigo se probó en SQL Server 2000, no se probó en otras versiones como 2005 o 2008. Aun asi no se aplica para MySQL, porque no existe la tabla "sysindexes":
$cnx = odbc_connect("dbSQLEmpresa","Admin","123");
if ($cnx)
{
$rs = odbc_exec($cnx, "SELECT * FROM alumnos");
$f = odbc_num_fields($rs);
$r = odbc_num_rows($rs);
$r = LFRJ_odbc_num_rows($cnx,"alumnos");
echo "<table border = '1'>";
for ($i = 1; $i <= $f; $i++)
{
$n = odbc_field_name($rs, $i);
echo "<th>", $n, "</th>";
}
while(odbc_fetch_row($rs))
{
echo "<tr>";
for ($i = 1; $i <= $f; $i++)
{
$d = odbc_result($rs, $i);
echo "<td>", $d, "</td>";
}
echo "</tr>";
}
echo "<tr><td colspan = '" . $f . "'>Campos(" . $f . ") Registros(" . $r . ")</td></tr>";
echo "</table>";
}
odbc_close($cnx);
function LFRJ_odbc_num_rows($cnx,$Tabla)
{
$rs = odbc_exec($cnx, "SELECT rows FROM sysindexes WHERE id = OBJECT_ID('" . $Tabla . "') AND indid < 2;");
return odbc_result($rs, 1);
}