Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 10th, 2012  |  syntax: None  |  size: 0.53 KB  |  hits: 5  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. // See the following OnpubAPI tutorial for more info:
  4. // http://onpubco.com/index.php?articleID=76&sectionID=2
  5.  
  6. // Establish the connection to the Onpub database.
  7. $pdo = new PDO( "mysql:host=localhost;dbname=test", "test", "test" );
  8.  
  9. // Include the OnpubAPI classes.
  10. include 'onpub/api/onpubapi.php';
  11.  
  12. // Construct an OnpubArticles object. This represents the OnpubArticles table
  13. // in the database.
  14. $oarticles = new OnpubArticles($pdo);
  15.  
  16. // Output the number of articles currently stored in the database.
  17. echo $oarticles->count();
  18.  
  19. ?>