【php开源代码栏目提醒】:网学会员--在 php开源代码编辑为广大网友搜集整理了:code7.30.php绩等信息,祝愿广大网友取得需要的信息,参考学习。
<?php
$con = mysql_connect("localhost", "root", "0");
if (!$con)
{
die('连接数据库出错的原因: ' . mysql_error());
}
$db_selected = mysql_select_db("db_student",$con);
$
sql = "SELECT * from student";
$result =
mysql_query($sql,$con);
echo "<table><tr>";
while ($property = mysql_fetch_field($result))
{
echo "<td>";
echo "列名: " . $property->name . "<br />";
echo "表名: " . $property->table . "<br />";
echo "Default value: " . $property->def . "<br />";
echo "Max length: " . $property->max_length . "<br />";
echo "Not NULL: " . $property->not_null . "<br />";
echo "Primary Key: " . $property->primary_key . "<br />";
echo "Unique Key: " . $property->unique_key . "<br />";
echo "Mutliple Key: " . $property->multiple_key . "<br />";
echo "Numeric Field: " . $property->numeric . "<br />";
echo "BLOB: " . $property->blob . "<br />";
echo "Field Type: " . $property->type . "<br />";
echo "Unsigned: " . $property->unsigned . "<br />";
echo "Zero-filled: " . $property->zerofill . "<br /><br />";
echo "</td>";
}
echo "</tr></table>";
mysql_close($con);
?>