<?php
mysql_connect("хост MySQL", "логин MySQL", "пароль MySQL");
mysql_select_db("БД MySQL");
$result = mysql_query("SELECT * FROM b_lang");
$fields = mysql_num_fields($result);
$rows = mysql_num_rows($result);
$table = mysql_field_table($result, 0);
echo "Your '".$table."' table has ".$fields." fields and ".$rows." record(s)<br>\n";
echo "The table has the following fields:\n";
for ($i=0; $i < $fields; $i++) {
$type = mysql_field_type($result, $i);
$name = mysql_field_name($result, $i);
$len = mysql_field_len($result, $i);
$flags = mysql_field_flags($result, $i);
echo $type." ".$name." ".$len." ".$flags."<br>\n";
}
mysql_free_result($result);
mysql_close();
?> |