Home > Backend Development > PHP Tutorial > PHP Get Field Name Example Sharing_PHP Tutorial

PHP Get Field Name Example Sharing_PHP Tutorial

WBOY
Release: 2016-07-13 10:37:05
Original
1059 people have browsed it

复制代码 代码如下:

$link = mysql_connect('localhost', 'username', 'password');
$fields = mysql_list_fields("database", "table", $link);
$columns = mysql_num_fields($fields);
$field = false;
for ($i = 0; $i < $columns; $i++) {
    $field .= "'".mysql_field_name($fields, $i) . "',";
}
print $field;

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/736820.htmlTechArticle复制代码 代码如下: ?php $link = mysql_connect('localhost', 'username', 'password'); $fields = mysql_list_fields("database", "table", $link); $columns = mysql_num_fields($fi...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template