PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

dbase_get_record_with_names> <dbase_delete_record
Last updated: Fri, 18 Jul 2008

view this page in

dbase_get_header_info

(PHP 5)

dbase_get_header_info — Ottenere le informazioni di intestazione di un database dBase

Descrizione

array dbase_get_header_info ( int $dbase_identifier )

Restituisce informazioni sulla struttura delle colonne del database referenziato da dbase_identifier . Per ogni colonna del database, esiste un valore specificato in un array ad indice numerico. L'indice dell'array inizia da 0. Ogni elemento dell'array contiene un array associativo di informazioni sulle colonne. Se l'informazione dell'header dell'array non può esssere letta, viene restituito, FALSE .

Gli elementi dell'array sono:

nome
Il nome della colonna
tipo
Il nome del tipo di colonna del dBase riconoscibile dall'utente (es. data, boolean, etc)
lunghezza
Il numero di bytes che la colonna può contenere
precisione
Il numero di cifre della precisione decimale della colonna
formato
Un formato di printf() suggerito, specifico per la colonna
offset (scostamento)
L'offest, in byte, della colonna dall'inizio riga

Example #1 Mostra le informazioni dell'header di un file di database in formato dBase

<?php
// Path to dbase file
$db_path "/tmp/test.dbf";

// Open dbase file
$dbh dbase_open($db_path)
    or die(
"Errore! Il file di database dBase non può essere aperto '$db_path'.");

// Get column information
$column_info dbase_get_header_info($dbh);

// Display information
print_r($column_info);
?>



add a note add a note User Contributed Notes
dbase_get_header_info
Eliovir
24-Jul-2008 05:04
As of PHP 5.2.6, it seems that the type F (Float) is supported ( ext/dbase/dbase.c +713 ), with a length of 20 characters.

http://www.dbase.com/KnowledgeBase/int/db7_file_fmt.htm precises : Number stored as a string, right justified, and padded with blanks to the width of the field
christoph dot eck at bluewin dot ch
12-Sep-2006 03:58
Field Types
*********
Not all field types of DBase are supported. Look below for the internal field type definitions of PHP 5.1.x.

The storage symbols of DBase are C (stands for character), D (date) , I (integer), N (number), L (boolean), M (memo). All other symbols like B, @, l, +, F, O and G are defined as unknown.

Sources
*********
http://www.dbase.com/KnowledgeBase/int/db7_file_fmt.htm
PHP-Source-5.1.6 ext/dbase/dbase.c (line 786)

dbase_get_record_with_names> <dbase_delete_record
Last updated: Fri, 18 Jul 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites