$sql = "SELECT * from Person";
$result = mysql_query($sql,$con);
while ($property = mysql_fetch_field($result))
{
echo "Field name: " . $property->name . "
";
echo "Table name: " . $property->table . "
";
echo "Default value: " . $property->def . "
";
echo "Max length: " . $property->max_length . "
";
echo "Not NULL: " . $property->not_null . "
";
echo "Primary Key: " . $property->primary_key . "
";
echo "Unique Key: " . $property->unique_key . "
";
echo "Mutliple Key: " . $property->multiple_key . "
";
echo "Numeric Field: " . $property->numeric . "
";
echo "BLOB: " . $property->blob . "
";
echo "Field Type: " . $property->type . "
";
echo "Unsigned: " . $property->unsigned . "
";
echo "Zero-filled: " . $property->zerofill . "
";
}
关键字段:
echo "Primary Key: " . $property->primary_key . "
";