11
Adodb RecordCount( ) Examples
Count number of rows in the record set
<?php
//example 1
$ra = $DB->execute('SELECT * FROM articles WHERE id = '.$DB->qstr($id).'');
if(!$ra)
print $DB->ErrorMsg();
else
while(!$ra->EOF) {
$numrows = $ra->PO_RecordCount();
echo $numrows;
//$title = $ra->fields['title'];
$ra->MoveNext();
}
?>
<?php
//example 2
$ra = $conn->Execute('SELECT * FROM articles WHERE id = '.$DB->qstr($id).'');
if($ra) {
if($ra->fields > 0) {
$numrows = $ra->PO_RecordCount("articles");
echo $numrows;
}
}
?>
Interserver | Standard & VPS Cloud Hosting | $2.50 /Month
Flexible VPS hosting platform to deploy your online projects.
Economical and balanced between processor cores, memory and storage
rated 11 times
(11)
(0)
comments: 0 / hits: 4695
/ 7 years ago, thu, dec 1, 16, 06:27:26
More From
» PHP
Comments
There are no comments for this Snippet yet