Hostign Towebs
 
    BUSCARDOR 
 
pg_meta_data

pg_meta_data

(PHP 4 >= 4.3.0, PHP 5)

pg_meta_data --  Get meta data for table

Descripción

array pg_meta_data ( resource connection, string table_name )

pg_meta_data() returns table definition for table_name as an array.

Aviso

Esta función es EXPERIMENTAL. Esto significa que el comportamiento de esta función, el nombre de esta función y en definitiva TODO lo documentado sobre esta función, puede cambiar en una futura version de PHP SIN AVISO. La advertencia queda hecha, y utilizar esta extensión queda bajo su propia responsabilidad.

Lista de parámetros

connection

PostgreSQL database connection resource.

table_name

The name of the table.

Valores retornados

An array of the table definition, or FALSE on error.

Ejemplos

Ejemplo 1. Getting table metadata

<?php
  $dbconn
= pg_connect("dbname=publisher") or die("Could not connect");

  
$meta = pg_meta_data($dbconn, 'authors');
  if (
is_array($meta)) {
      echo
'<pre>';
      
var_dump($meta);
      echo
'</pre>';
  }
?>

El resultado del ejemplo seria:

array(3) {
["author"]=>
array(5) {
  ["num"]=>
  int(1)
  ["type"]=>
  string(7) "varchar"
  ["len"]=>
  int(-1)
  ["not null"]=>
  bool(false)
  ["has default"]=>
  bool(false)
}
["year"]=>
array(5) {
  ["num"]=>
  int(2)
  ["type"]=>
  string(4) "int2"
  ["len"]=>
  int(2)
  ["not null"]=>
  bool(false)
  ["has default"]=>
  bool(false)
}
["title"]=>
array(5) {
  ["num"]=>
  int(3)
  ["type"]=>
  string(7) "varchar"
  ["len"]=>
  int(-1)
  ["not null"]=>
  bool(false)
  ["has default"]=>
  bool(false)
}
}

Ver también

pg_convert()



 
 
Rute path: HOME / MANUALES Y TUTORIALES / MANUAL DE PHP
Home | Hosting | Housing | Revendedores | Soporte | Empresa | Mapa del Sitio | Contacto | FAQ | Blog Corporativo
Atención técnica y comercial: (54)-11-5031-1111 las 24 hs. los 365 días del año. ToWebs, (c) 2008
Virtucom Networks S.A Av. Belgrano 1586, piso 10 (C1093AAQ) Cap. Fed. Bs. As, Argentina.