I'm trying to select specific post which are first filtered. Then once I have the "topic_first_post_id" value I past that to my second query where the "topic_first_post_id" equals "post_id" . Then of course once that filter is done its suppose to display the subject and text from the database. As of right now my error is displayed here: http://www.teamlord.net/modules.php?name=cSchedule
I admit I'm not very php efficient and lack several skills. Someone suggested maybe using array but I'm not familar with that coding yet.
$connection = mysql_connect($dbhost, $dbuname, $dbpass) or die ("Unable to connect!");
mysql_select_db($dbname) or die ("Unable to select database!");
$query1 = "SELECT topic_first_post_id FROM nuke_bbtopics WHERE forum_id=10 and topic_status=0 and topic_type=0 ";
$result1 = mysql_query($query1) or die ("Error in query: $query1. " . mysql_error());
//posting the match
while ($row1 = mysql_fetch_object($result1))
{
$test = "echo $row1->topic_first_post_id";
$query2 = "SELECT post_subject, post_text FROM nuke_bbposts_text WHERE post_id=$test ";
$result2 = mysql_query($query2) or die ("Error in query: $query1. " . mysql_error());
while ($row2 = mysql_fetch_object($result2))
{
echo $row2->post_subject;
?>
<br><br>
<?
echo $row2->post_text;
}
}