
Untitled
By: a guest on
Jul 10th, 2012 | syntax:
None | size: 0.53 KB | hits: 5 | expires: Never
<?php
// See the following OnpubAPI tutorial for more info:
// http://onpubco.com/index.php?articleID=76§ionID=2
// Establish the connection to the Onpub database.
$pdo = new PDO( "mysql:host=localhost;dbname=test", "test", "test" );
// Include the OnpubAPI classes.
include 'onpub/api/onpubapi.php';
// Construct an OnpubArticles object. This represents the OnpubArticles table
// in the database.
$oarticles = new OnpubArticles($pdo);
// Output the number of articles currently stored in the database.
echo $oarticles->count();
?>