i’m trin to open one table to grab the a value to specify in the second table. then display a name from the first table(and repeat for each) then use a while to display certain records from the second table. Here’s my code cuz that probably confused you.
[code=php] $query = “Select * from category”;
$result = mysql_query($query, $dbconn);
while (mysql_fetch_assoc($result)) {
$catid = $cat[“id”];
$catname = $cat[“name”];
}
$catarr = array($catname);
$query2 = “Select * from forum where CID = “. $catid .””;
$result2 = mysql_query($query2, $dbconn);
foreach($catarr as $catey) {
echo “<table>”;
echo “<tr><td colspan=”4″>$catey</td></tr>”;
echo “<tr><td>Forum</td><td>Total Topics</td><td>Total Posts</td><td>Last Update</td></tr>”;
while($row = mysql_fetch_object($result2)){
$name = $row->name;
$descripe = $row->description;
$threads = $row->t_count;
$posts = $row->p_count;
$updated = $row->updated;
$updater = $row->updater;
echo “<tr><td>$name<br>$descripe</td>”;
echo “<td>$threads</td>”;
echo “<td>$posts</td>”;
echo “<td>$updated<br>By:$updater</td></tr>”;
}
echo “<tr><td colspan=”4″> </td></tr>”;
echo “</table>”;
}
the problem is the variables are only grabbing the top record(or highest, however u look at it)
P.S. Yes this is another forum, well start. I’m wanting to make one to learn php/mysql better, cuz a forum uses tons of it. I’ve already got a forum built in asp, so the goals not to get one built, but to learn.
TThanks in advanced