Jump to content

PHP Blocked Out Code?


Guest

Recommended Posts

I would thoroughly enjoy if someone solved this.  The problem is, is that I want the forum name of any created forum I make displayed by PHP.  All of my other codes work except this one...

 

<!-- forum info-->
				<?php
					#get forum infos
					$forum = fetch("SELECT fid, name FROM forums WHERE fid = ".$fid);
					if(!$forum) $forum = array();
				?>
				<table class="foruminfo" cellspacing="0">
					<tbody>
						<tr>
							<td class="foruminfoleft">
								<div class="forumdescwrap">
									<img class="forumicon" src="/images/cornerpic.jpg">
									<h3 class="forumname"><a href="?fid=<?php echo $forum[0] ;?>"><?php echo $forum[1];?></a></h3>

 

Now, that code above seems to work and show the forum name when I take out this code on another PHP file I have:

 

function fetch($query) { $r = mysql_query($query); if($f) {return mysql_fetch_row($r);}}

 

Any suggestions?

Link to comment
Share on other sites

Change this:

function fetch($query) { $r = mysql_query($query); if($f) {return mysql_fetch_row($r);}}

 

To this:

function fetch($query) { $r = mysql_query($query); if($r) {return mysql_fetch_row($r);}}

 

In the IF statement you were checking $f when you should have been checking $r

Link to comment
Share on other sites

Oh, wow, thanks, man!  Fixed both my issues.  :)

 

If you are reading this again, would you know how to do this?:

 

http://trigamer.com/forums/newest.php?fid=1

 

If you go to that link, how could I fix the blue bar at the top?

failbar.png

 

 

But on this page it is perfect and I don't even think any of the coding is different.

 

http://trigamer.com/forums/replythread.php?tid=11

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.