Documentation Home
MySQL PHP API
Download this Manual
PDF (US Ltr) - 2.8Mb
PDF (A4) - 2.8Mb
EPUB - 456.8Kb
HTML Download (TGZ) - 396.0Kb
HTML Download (Zip) - 409.8Kb


MySQL PHP API  /  ...  /  MysqlndUhConnection::listFields

9.7.25 MysqlndUhConnection::listFields

Copyright 1997-2014 the PHP Documentation Group.

  • MysqlndUhConnection::listFields

    List MySQL table fields

Description

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

List MySQL table fields.

Warning

This function is currently not documented; only its argument list is available.

Parameters

connection

Mysqlnd connection handle. Do not modify!

table

The name of the table that's being queried.

pattern

Name pattern.

Return Values

Examples

Example 9.32 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($ret, true));
  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);
?>

    

The above example will output:


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


See Also

mysqlnd_uh_set_connection_proxy
mysql_list_fields


User Comments
Sign Up Login You must be logged in to post a comment.