你使用的函数就是单条的。请换成mysql_fetch_field
<?php$con = mysql_connect("localhost", "hello", "321")
if (!$con)
{
die('Could not connect: ' . mysql_error())
}
$db_selected = mysql_select_db("test_db",$con)
$sql = "SELECT * from Person"
$result = mysql_query($sql,$con)
while ($property = mysql_fetch_field($result))
{
echo "Field name: " . $property->name . "<br />"
echo "Table name: " . $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 />"
}
mysql_close($con)
?>
left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录
inner join(等值连接) 只返回两个表中联结字段相等的行
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)