PHP查询MYSQL表的主键
2024-10-18 19:29:44
$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 />";
}
关键字段:
echo "Primary Key: " . $property->primary_key . "<br />";
最新文章
- css 文字溢出隐藏 带省略号
- C#中web页面之间传递数组参数
- phpcms分页用法简介
- MVC 為頁面的list資料重新命名
- keil编译STM32工程时 #error directive: ";Please select first the target STM32F10x device used in your application (in stm32f10x.h file)";
- 【USACO 3.1.6】邮票
- [Python Web]部署完网站需要做的一些后续工作
- [转载] 深入剖析 redis 主从复制
- faster-rcnn系列笔记(一)
- mobile_像素
- returnFunc.js
- Linux内核分析 读书笔记 (第五章)
- centos7 服务操作命令
- 【算法】Huffman编码(数据结构+算法)
- 微信小程序-携带参数的二维码条形码生成
- dp之二维背包poj1837(天平问题 推荐)
- git练习
- 【DUBBO】Dubbo:protocol 的配置项
- window server 搭建git服务器
- Nginx配置中last和break及permanent和redirect的区别