Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 获取mysql表列说明_Php_Mysql_Sql - Fatal编程技术网

Php 获取mysql表列说明

Php 获取mysql表列说明,php,mysql,sql,Php,Mysql,Sql,我正在尝试获取表的列说明 我尝试了fetch\u fields(),但它没有获取描述(仅获取名称、类型、长度…) $finfo=$result->fetch_fields(); foreach($finfo作为$val){ if(在数组中($val->name,$columns['names'])){ $ths.=''.$val->name'; } } 您可以从中获取列注释。您可以从中获取列注释 $finfo = $result->fetch_fields();

我正在尝试获取表的列说明 我尝试了
fetch\u fields()
,但它没有获取描述(仅获取名称、类型、长度…)

$finfo=$result->fetch_fields();
foreach($finfo作为$val){
if(在数组中($val->name,$columns['names'])){
$ths.=''.$val->name';
}
}

您可以从中获取
列注释。

您可以从中获取
列注释

  $finfo = $result->fetch_fields();
                foreach ($finfo as $val) {
                    if (in_array($val->name, $columns['names'])){
                        $ths .= '<th scope="col" id="'.$val->name.'">'.$val->name. '</th>';
                    }
                }