略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: MysqlndUhConnection::listFields

2024-12-21

MysqlndUhConnection::listFields

(PECL mysqlnd-uh >= 1.0.0-alpha)

MysqlndUhConnection::listFieldsList MySQL table fields

说明

public MysqlndUhConnection::listFields ( mysqlnd_connection $connection , string $table , string $achtung_wild ) : array

List MySQL table fields.

Warning

本函数还未编写文档,仅有参数列表。

参数

connection

Mysqlnd connection handle. Do not modify!

table

The name of the table that's being queried.

pattern

Name pattern.

返回值

范例

Example #1 MysqlndUhConnection::listFields() example

<?php
class proxy extends MysqlndUhConnection {
 public function 
listFields($res$table$pattern) {
  
printf("%s(%s)\n"__METHOD__var_export(func_get_args(), true));
  
$ret parent::listFields($res$table$pattern);
  
printf("%s returns %s\n"__METHOD__var_export($rettrue));
  return 
$ret;
 }
}
mysqlnd_uh_set_connection_proxy(new proxy());

$mysql mysql_connect("localhost""root""");
mysql_select_db("test"$mysql);
mysql_query("DROP TABLE IF EXISTS test_a"$mysql);
mysql_query("CREATE TABLE test_a(id INT, col1 VARCHAR(255))"$mysql);
$res mysql_list_fields("test""test_a"$mysql);
printf("num_rows = %d\n"mysql_num_rows($res));
while (
$row mysql_fetch_assoc($res))
 
var_dump($row);
?>

以上例程会输出:

proxy::listFields(array (
  0 => NULL,
  1 => 'test_a',
  2 => '',
))
proxy::listFields returns NULL
num_rows = 0

参见

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/mysqlnduhconnection.listfields.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3