I've changed the code to $dbname=$wpdb; (code below) but I'm still getting the following results. Thank you so much for your continuing help.
mabnbpdb@aol.com
--------------------------------------------------------------------
nformation_schema rec0832109095959
querystr is string
querystr is SELECT * FROM posts
query is NULL
Warning: Invalid argument supplied for foreach() in /home/content/m/a/r/maryandpaul/html/rt/filedata2.php5 on line 37
-------------------------------------------------------------------
<?php
//Connect To Database
$hostname="rec0832109095959.db.3175150.hostedresource.com";
$username="rec0832109095959";
$password="rbnl7Gx4";
$dbname=$wpdb;
$usertable="wp_posts";
$yourfield = "post_author";
$db = "rec0832109095959";
$link = mysql_connect($hostname,$username, $password) or die ("<html><script language='JavaScript'>alert('Unable to connect to database! Please try again later.'),history.go(-1)</script></html>");
mysql_select_db($dbname);
global $wpdb;
global $type;
include ('wp-db.php');
$db_list = mysql_list_dbs($link);
while ($row = mysql_fetch_object($db_list)) {
echo $row->Database . "\n";
}
$querystr = 'SELECT * FROM '.$wpdb->prefix.'posts';
$query = $wpdb->get_results($querystr);
$type = gettype($querystr);
echo '
' . "querystr is $type" . '
';
echo '
' . "querystr is $querystr" . '
';
$type = gettype($query);
echo '
' . "query is $type" . '
';
foreach ($query as $value) { echo $value;}
?>