For some reasone no matter what I do, I can't get this MySQL/PHP code to work. Here is what I have:
<?php
$categories = mysql_query("SELECT * FROM " . $prefix . "categories ORDER BY catorder", $connection);
while ($row = mysql_fetch_assoc($categories)) {
$catresult = mysql_query("SELECT * FROM " . $prefix . "boards WHERE cat_id = '$row[cat_id]' ORDER BY boardorder") OR DIE("Gravity Board X was unable to execute the view boards script: " . mysql_error());
while($boardrow = @mysql_fetch_assoc($catresult)){
$threadidquery = mysql_query("SELECT thread_id FROM " . $prefix . "threads WHERE board_id = '$boardrow[board_id]' ORDER BY last_msg_time DESC LIMIT 1") OR DIE("Gravity Board X was unable to select the most recent thread id: " . mysql_error());
$tiquery = @mysql_fetch_assoc($threadidquery);
$postinfo = mysql_query("SELECT * FROM " . $prefix . "posts WHERE msg_id = '$tiquery[first_msg]'") OR DIE("Gravity Board X was unable to select the most recent post info: " . mysql_error());
$pi = @mysql_fetch_assoc($postinfo);
$uiquery = mysql_query("SELECT displayname FROM " . $prefix . "members WHERE memberid = '$pi[memberid]'") OR DIE("Gravity Board X was unable to select the most recent post user info: " . mysql_error());;
$ui = mysql_fetch_array($uiquery);
$tcquery = mysql_query("SELECT COUNT(*) FROM " . $prefix . "threads WHERE board_id = '$boardrow[board_id]'") OR DIE("Gravity Board X was unable to select the thread count for board " . $board_id . ": " . mysql_error());
$pcquery = mysql_query("SELECT COUNT(*) FROM " . $prefix . "posts WHERE board_id = '$boardrow[board_id]'") OR DIE("Gravity Board X was unable to select the post count for board " . $board_id . ": " . mysql_error());
$tcrow = @mysql_fetch_array($tcquery);
$pcrow = @mysql_fetch_array($pcquery);
$postrow = mysql_fetch_assoc($postinfo);
?>
Then here are some variables I echo to be displayed, some work, some don't (a *** means it does work):
echo $boardrow["board_id"];
echo $boardrow["name"];
echo $boardrow["description"];
echo $tcrow[0];
echo $pcrow[0];***
echo $postrow["dateposted"];
echo $ui["displayname"];
I thank you SO much for any help you can give me! 🙂