ociRowCount

ociRowCount -- Retourne le nombre de lignes affectées.

Description

int ocirowcount ( resource statement)

ocirowcount( ) retourne le nombre de lignes affectées par une commande de modification . Cette fonction ne vous indiquera pas le nombre de lignes retournées par un SELECT : il faut que les lignes aient été modifiées .

Exemple 1 . ociRowCount

 
?php

 
print

 
"

 
HTML

 
PRE

 
"

 
;

 
$conn

 
=

 
ociLogon("scott"

 
,"tiger")

 
;

 
$stmt

 
=

 
ociparse($conn

 
,"create

 
table

 
emp2

 
as

 
select

 
*

 
from

 
emp")

 
;

 
ociexecute($stmt)

 
;

 
print

 
ociRowCount($stmt

 
)

 
.

 
"

 
rows

 
inserted

 
.

 
br

 
"

 
;

 
ociFreeStatement($stmt)

 
;

 
$stmt

 
=

 
ociparse($conn

 
,"delete

 
from

 
emp2")

 
;

 
ociexecute($stmt)

 
;

 
print

 
ociRowCount($stmt

 
)

 
.

 
"

 
rows

 
deleted

 
.

 
br

 
"

 
;

 
ociCommit($conn)

 
;

 
ociFreeStatement($stmt)

 
;

 
$stmt

 
=

 
ociparse($conn

 
,"drop

 
table

 
emp2")

 
;

 
ociexecute($stmt)

 
;

 
ociFreeStatement($stmt)

 
;

 
ociLogOff($conn)

 
;

 
print

 
"

 
/

 
PRE

 
/

 
HTML

 
"

 
;

 
?