PHP Code:
<?php $db = mysql_connect('localhost','myuserid','mypasswd'); mysql_select_db('db01'); $qryblog01_posts = "select count(*) -1 as ct from wp_posts"; $qryblog01_comments = "select count(*) as ct from wp_comments"; $result01_posts = mysql_query($qryblog01_posts); $result01_comments = mysql_query($qryblog01_comments);
if ($result01_posts && $result01_comments)
{
$array01_posts = mysql_fetch_array($result01_posts);
$array01_comments = mysql_fetch_array($result01_comments);
} mysql_select_db('db02'); $qryblog02_posts = "select count(*) -1 as ct from wp_posts"; $qryblog02_comments = "select count(*) as ct from wp_comments"; $result02_posts = mysql_query($qryblog02_posts); $result02_comments = mysql_query($qryblog02_comments);
if ($result02_posts && $result02_comments)
{
$array02_posts = mysql_fetch_array($result02_posts);
$array02_comments = mysql_fetch_array($result02_comments);
}
mysql_select_db('db03'); $qryblog03_posts = "select count(*) -1 as ct from wp_posts"; $qryblog03_comments = "select count(*) as ct from wp_comments"; $result03_posts = mysql_query($qryblog03_posts); $result03_comments = mysql_query($qryblog03_comments);
if ($result03_posts && $result03_comments)
{
$array03_posts = mysql_fetch_array($result03_posts);
$array03_comments = mysql_fetch_array($result03_comments);
} mysql_close();?>
No comments:
Post a Comment