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.
dbase_numfields
(PHP 4, PHP 5)
dbase_numfields — データベースのフィールド数を得る
説明
int dbase_numfields
( int
$dbase_identifier
)指定したデータベースにおけるフィールド(カラム)数を取得します。
注意:
フィールド番号は 0 から dbase_numfields($db)-1 までで、 一方レコード番号は 1 から dbase_numrecords($db) までです。
返り値
データベースのフィールド数を返します。エラーが発生した場合には
FALSE を返します。
例
例1 dbase_numfields() の例
<?php
$rec = dbase_get_record($db, $recno);
$nf = dbase_numfields($db);
for ($i = 0; $i < $nf; $i++) {
echo $rec[$i], "\n";
}
?>
paul_andrec at hotmail dot com ¶
3 years ago
