$story_query = "SELECT table_name, id FROM planning WHERE parent = '$novelnum'";
$story_result = db_query($story_query);
while($story_row = db_fetch_array($story_result)) {
$taleTable_Name = $story_row['table_name'];
$postid[] = $story_row['id'];
$q2 = "Select * from $taleTable_Name where approved='Y' order by id";
$bset2 = db_query($q2);
while($rset2 = db_fetch_array($bset2)) {
$i[] = $rset2['id'];
$t[] = $rset2['thread'];
$s[] = $rset2['subject'];
$a[] = $rset2['author'];
$d[] = $rset2['datestamp'];
}
}
if(isset($d)) {
$fc = count($d);
if($fc > 20) {
$xs = $fc - 20;
}
else {
$xs = 0;
}
for($c=$xs;$c<$fc;$c++) {
if($s[$c] != "") {
$newpost .= $d[$c];
$newpost .= " <a href='../forums/read.php?f=";
$newpost .= end($postid);
$newpost .= "&i=";
$newpost .= $i[$c];
$newpost .= "&t=";
$newpost .= $t[$c];
$newpost .= "'>" ;
$newpost .= $s[$c];
$newpost .= "</a> by ";
$newpost .= $a[$c];
$newpost .= $taleTable_Name;
$newpost .= "<br>\n";
}
}
}
else {
$newpost = "There are no posts for this scroll yet.";
}
The above code correctly presents me with all the entries found with $taleTable_Name, but only presents the last variable of $postid when I print $newpost. I want the id ($postid to match the table_name ($taleTable_Name) so that the url created actually goes to the correct forum.