Wed, May 25, 2022
https://devcodepro.comdevcodepro
Home · Latest · Trends
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;
 }
}
?>
rated 11 times (11) (0)
comments: 0 / hits: 4290  / 6 years ago, thu, dec 1, 16, 06:27:26
More From » PHP
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
Login with Google
 
Share
Posted
Micky
Member since Nov 12, 2016
Total Code Snippets: 5
Total Comments: 2
Location: n/a
Micky snippets
6 years ago, wed, dec 7, 16, 12:37:43
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> </head> <body> <script> $(function() { $("a.random").click(function() { $(".div1").load(location.href + " .div1"); }); }); </script> <a class="random">Click Here</a> <div class="div1"><?php echo rand(10000,50000); ?></div> </body> </html>
comments: 0 / hits: 5643
6 years ago, thu, dec 8, 16, 6:21:29
$DB->Execute('INSERT INTO mytable(posts) VALUES('.$DB->qstr($title).')'); $get_last_id = $DB->insert_id(); echo $get_last_id;
comments: 1 / hits: 10203
PHP
5 years ago, thu, mar 2, 17, 6:35:12
1. In /styles/YOURTEMPLATE/template/bbcode.html replace this code: <!-- BEGIN code_open --><div class="codebox"><p>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></p><pre><code><!-- END code_open --> with this code: <!-- BEGIN code_open --><div class="codebox"><p>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></p><pre class="prettyprint"><code><!-- END code_open --> 2. In styles/YOURTEMPLATE/template/overall_header.html put this code in HEAD section of the HTML <script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script> 3. Go to ACP - > Purge Cache
comments: 0 / hits: 10489
5 years ago, thu, aug 3, 17, 2:59:59
.btn-primary.focus, .btn-primary:focus { -webkit-box-shadow: none!important; box-shadow: none!important; }
comments: 0 / hits: 14907
CSS