Now this is for a forum, the code seems completely fine for me, and I even tested the queries in mysql command line and they worked. But when I run the script all it does it load, and load, and load, and even stop.. and not give me back anything information. Can anyone help me with this?
All the $DB_site-> are connections to my database class, mysql connection is not a problem here.
Thanks for your time
$forum_db = $DB_site->query("SELECT * FROM forum");
if ($forum = $DB_site->fetch_array($forum_db)) {
do {
echo "<table>";
echo "<tr><td>$forum[title]</td></tr>";
$top10_db = $DB_site->query("SELECT * FROM post LEFT JOIN thread ON post.threadid = thread.threadid WHERE thread.forumid='$forum[forumid]' ORDER BY post.userid LIMIT 10");
if ($top10 = $DB_site->fetch_array($top10_db)) {
do {
echo "<tr><td>$top10[username]</td></tr>";
} while ($top10 = $DB_site->fetch_array($top10_db));
}
echo "</table>";
echo "<br/>";
} while ($forum = $DB_site->fetch_array($forum_db));
}