PHP mysqli获取数据表以及表结构

摘要:
php$mysqli=newmysqli('localhost'?'le'),$result=$mysqli->查询(“SHOWTABLES”);fetch_Assoc()){//编辑查询结果$tables[]=$arr;}echo'<';//通过字段名$result=$mysqli->获取数据表结构;查询('DESCRIBEusers');

<?php
$mysqli = new mysqli('localhost','root','','le');
$result = $mysqli->query('SHOW TABLES');//执行查询语句
//输出此数据库中表结构
$tables = array();
while($arr = $result->fetch_assoc()){
//编辑查询结果
$tables[] = $arr;
}
echo '<br/>';
//通过字段名获取数据表结构
$result = $mysqli->query('DESCRIBE users');
$column[] = $arr;
while($arr = $result->fetch_assoc()){
$column[] = $arr;
}
var_dump($column);

免责声明:文章转载自《PHP mysqli获取数据表以及表结构》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇CC攻击:linux-Apache的ab工具phantomJs页面操作下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

layui模板和jfinal混合使用注意

<!-- 列表信息展示 --> <div class="layui-row"> <table class="layui-table" lay-data="{url:'/student/student/studentCurriculum?id=#(student.id)', page:true,...

阿里人脸识别接口

最近研究了一下阿里的人脸识别功能,只是调用阿里提供的接口返回数据给我们就OK了。详细文档可参考阿里的api  阿里人脸识别api 人脸比对的方法 直接上代码吧: 1 package com.guoxin.common.test; 2 3 import sun.misc.BASE64Encoder; 4 import javax.cryp...

WPF 中如何使用第三方控件 ,可以使用WindowsFormsHost 类

允许在 WPF 页面上承载 Windows Forms控件的元素。 命名空间:   System.Windows.Forms.Integration 程序集:   WindowsFormsIntegration(在 WindowsFormsIntegration.dll 中) 用于 XAML 的 XMLNS:http://schemas.microsof...

【转】ARM 指令集版本和ARM 版本

----转载自: http://www.cnblogs.com/loleng/archive/2011/06/14/2080447.html 常常能看到ARM7,ARM9,ARM11,以及armv6k等不同的表达。且在GCC编译中,常常要用到 -march, -mcpu等。他们分别表达什么涵义呢?Sam自己也不很清楚,只是大概有个模糊的概念。今天就仔细研究...

Python与微信——itchat包

目录 itchat itchat 一安装itchat pip install itchat pip install echarts-python 二登陆并向文件传输助手发消息 ``` import itchat 登录 itchat.login() 发送消息,filehelper是文件传输助手 itchat.send(u'hello', 'fileh...

探索photo-sphere-viewer全景插件

此插件是一位外国人写的,官网API地址:https://photo-sphere-viewer.js.org/#methods, 点击看效果吧 3d旋转的amp: https://github.com/ampproject/amphtml Three.js: https://threejs.org/docs/index.html http://victu3...