PHP 5.4.31 Released

dbase_numfields

(PHP 4, PHP 5)

dbase_numfields Restituisce il numero di campi in un database dBase.

Descrizione

int dbase_numfields ( int $dbase_identifier )

Restituisce il numero di campi (colonne) nel databaase specificato. I numeri dei campi sono compresi tra 0 e dbase_numfields($db)-1, mentre i numeri dei records sono compresi tra 1 e dbase_numrecords($db).

Example #1 Usare dbase_numfields()

<?php

$rec 
dbase_get_record($db$recno);
$nf  dbase_numfields($db);
for (
$i=0$i $nf$i++) {
    echo 
$rec[$i]."<br>\n";
}
?>

add a note add a note

User Contributed Notes 1 note

up
1
paul_andrec at hotmail dot com
4 years ago
When you want to add a record to a table you have to exclude the last row deleted.

So lets say your table have 10 rows with the deleted row to a total of 11.
you have to exclude the deleted row in your array();

sample:

table is :

<?php
$row
($PID,$SID,$RID,$CON,$COM,$AD1,$AD2,$CIT,$STA,$ZIP,$deleted);
$record=array($PID,$SID,$RID,$CON,$COM,$AD1,$AD2,$CIT,$STA,$ZIP,);
$db = dbase_open($db_path_and_file,2);
dbase_add_record($db,$record );
dbase_close($db);
?>

This will work.
To Top