fbsql_affected_rows

(PHP 4 >= 4.0.6)

fbsql_affected_rows --  直近のFrontBase処理により作用を受けたレコードの数を得る

説明

int fbsql_affected_rows (int [link_identifier])

fbsql_affected_rows() は、 link_identifierが指す接続において 直近のINSERT, UPDATE, DELETEクエルで作用されたレコードの数を返し ます。リンクIDが指定されない場合、 fbsql_connect()により直近にオープンされた接続 が使用されます。

注意 トランザクションを使用している場合、コミットの後ではなくINSERT, UPDATE, DELETEクエリの後で fbsql_affected_rows()をコールする必要がありま す。

直近のクエリがWHERE句のあるDELETEクエリの場合、全てのレコードは、 テーブルから削除されますが、この関数はゼロを返します。

注意 When using UPDATE, FrontBase will not update columns where the new value is the same as the old value. This creates the possiblity that fbsql_affected_rows() may not actually equal the number of rows matched, only the number of rows that were literally affected by the query.

If the last query failed, this function will return -1.

fbsql_num_rows()も参照下さい。