DarkArchon Posted February 15, 2008 Share Posted February 15, 2008 Ok, what I'm trying to do here is fetch info from a phpBB3 forum and put it up on the front page of my site in a little group of 3. However, I'm having problems (or I wouldn't be here). I believe the problem has something to do with line 10. If I comment it and the brackets with it out I can make it all the way to line 26 before something screams at me, the news.php will also show a good connection at that point. The error it's giving me now can be found at the bottom of my page http://www.orderofatlas.com/as/index.php look for the "Testing goes here!" block. Right now it says the error occurs on line 12, but if you go to news.php it doesn't show an output at all, either failed or good, which indicates to me that it's not making it that far (again, line 10 maybe?). Anyway, I'm hoping someone else here can shed some light on this. I'm probably missing something obvious, but have been staring at it too long to see it. Thanks <?php // Set variables to connect to server $Forum = 24; $Host = localhost; $User = username; $Password = password; $Database = database; // Function for connected to the database function create_db_connection($Database) { $link = mysqli_connect($Host, $User, $Password, $Database); if (!$link) { printf("\n\nConnect failed: %s\n", mysqli_connect_error()); exit(); } printf("\n\nHost information: %s\n", mysqli_get_host_info($link)); } // Fetches X number of rows "notice(3)" function notice($row) { $Forum; create_db_connection("$Database"); $res = mysqli_query("SELECT topic_id, topic_title, topic_time FROM phpbb_topics WHERE forum_id=$Forum ORDER BY topic_id DESC LIMIT $row"); if (!$res || mysqli_num_rows($res) == 0) { echo "<TR><TD VALIGN=\"TOP\" CLASS=maintext><FONT COLOR=#666666 face='Verdana, Arial, Helvetica, sans-serif' size=2>No News Entrys</TD></TR>"; return; } while (list($id, $topictitle, $topicdate) = mysqli_fetch_row($res) ) { $topicdate = date('M j/y', $topicdate); $iconhtml = ""; echo "<TR>"; echo " <TD VALIGN=\"TOP\" CLASS=\"maintext\" WIDTH=75 align=left> <FONT COLOR=#666666 face='Verdana, Arial, Helvetica, sans-serif' size=2>$topicdate</FONT></TD>"; echo " <TD VALIGN=\"TOP\" CLASS=\"maintext\" align=left width=4> <!-- was icon html --> </TD>"; echo " <TD VALIGN=\"TOP\" CLASS=\"maintext\" ALIGN=left width=215><FONT COLOR=#666666 face='Verdana, Arial, Helvetica, sans-serif' size=2><A HREF=/board/viewtopic.php?t=$id>$topictitle</A></FONT></TD>"; echo "</TR>"; } mysqli_free_result($res); } // Fetches all rows function all() { $Forum; create_db_connection("$Database"); $res = mysqli_query("SELECT topic_id, topic_title, topic_time FROM phpbb_topics WHERE forum_id=$Forum ORDER BY topic_id DESC LIMIT 50"); if (!$res || mysqli_num_rows($res) == 0) { echo "<TR><TD VALIGN=\"TOP\" ALIGN=\"CENTER\" CLASS=maintext><FONT COLOR=66666 face='Verdana, Arial, Helvetica, sans-serif' size=2>No News Entrys</TD></TR>"; return; } while (list($id,$topictitle,$topicdate) = mysqli_fetch_row($res)) { $topicdate = date('M j Y - h:i A', $topicdate); $iconhtml = " "; echo "<TR>"; echo " <TD CLASS='maintext' align=left><FONT COLOR='666666' face='Verdana, Arial, Helvetica, sans-serif' size=2>$topicdate</FONT></TD>"; echo " <TD VALIGN=\"TOP\" CLASS=maintext>$iconhtml</TD>"; echo " <TD CLASS='maintext' align=left><FONT face='Verdana, Arial, Helvetica, sans-serif' size=2><A HREF=/board/viewtopic.php?t=$id>".$topictitle."</A></FONT></TD>"; echo "</TR>"; } mysqli_free_result($res); } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.