Jump to content

forum index bug hoping to resolve


Faks

Recommended Posts

This is how looks bug looks : :-\

x2fj7gs1zxt7kpx8xw9t_thumb.jpg

 

Code

  echo "<div align='center' class='thread'>Forum</div>";
                                $forum_select = mysql_query("SELECT * FROM forum") or die (mysql_error());
                                while ($forum_show = mysql_fetch_array($forum_select))
                                {
                                $forum_name = mysql_query("SELECT * FROM forum_group");
                                while($forum_group_name = mysql_fetch_array($forum_name))
                                {
                                        if ($forum_group_name['hosting_forum_group_id'] == $forum_show['hosting_forum_group_id']) 
                                        {
                                        echo "<table width='900' border='1' align='center' cellpadding='0' cellspacing='0'>"; 
                                        echo "<tr><td colspan='6' style='padding: 7px;color:red'>".$forum_group_name['hosting_forum_group_name']."</td></tr>";
                                        echo "<tr><td style='white-space: nowrap;' align='center' width='1%'>".$forum_show['hosting_forum_icon']."</td>";
                                        echo "<td>"."<a href='/?section=forumview&id=".$forum_show['hosting_forum_id']." '>".$forum_show['hosting_forum_title']."</a><br />".$forum_show['hosting_forum_description']."</td>";
                                        echo "<td width='230'> </td></tr>";
                                        echo "</table><br>";
                                        }
                                }
                                }

 

I Hope to resolve the problem maybe somebody can explain where is my mistake to fix it and resolve it !

Link to comment
Share on other sites

It's very bad in terms of efficiency to have a query inside a loop. You can accomplish the same result using one query:

<?php
$q = "select forum.hosting_forum_icon, forum.hosting_forum_id, forum.hosting_forum_title, forum_group.hosting_forum_group_name from forum, forum_group where forum.hosting_forum_group_id = forum_group.hosting_forum_group_id";
$rs = mysql_query($q);
while ($rw = mysql_fetch_array($rs)) {
         echo "<table width='900' border='1' align='center' cellpadding='0' cellspacing='0'>"; 
         echo "<tr><td colspan='6' style='padding: 7px;color:red'>{$rw['hosting_forum_group_name']}</td></tr>";
         echo "<tr><td style='white-space: nowrap;' align='center' width='1%'>{$rw['hosting_forum_icon']}</td>";
         echo "<td>"."<a href='/?section=forumview&id={$rw['hosting_forum_id']}'>{$rw['hosting_forum_title']}</a><br />{$rw['hosting_forum_description']}</td>";
         echo "<td width='230'> </td></tr>";
         echo "</table><br>";
}
?>

 

Of course, you didn't tell us what was wrong with the picture.

 

Ken

Link to comment
Share on other sites

this code won't work because forum_group is different table in database the mistake is secondary forum must be once not twice showed they should be merged under it like in this forum index i hope somebody understand me because as native i having difficulty's to describe it in details .

Link to comment
Share on other sites

yes but i have to modify it but i am going to check it maybe it resolves the problem but as i see the code i am thinking about left join instead double select witch buffers the code :)

 

sad news bug is still present even with new code :( !

Link to comment
Share on other sites

i am using code witch were posted and still is the bug i don't use any more mine code ....

				#echo "<div align='center' class='thread'>Forum</div><table width='900' border='1' align='center' cellpadding='0' cellspacing='0'>";
			echo "<div align='center' class='thread'>Forum</div>";
			$forum_select = "select hosting_forum.hosting_forum_id,hosting_forum.hosting_forum_title,hosting_forum.hosting_forum_description,hosting_forum.hosting_forum_icon,hosting_forum_group.hosting_forum_group_name from hosting_forum, hosting_forum_group where hosting_forum.hosting_forum_group_id = hosting_forum_group.hosting_forum_group_id" or die (mysql_error());
			$forum_selects = mysql_query($forum_select);
			#echo "<tr><td colspan='6' style='padding: 7px;color:red'>"."Forumu nosaukimi nedarbojas"."</td></tr>";
			while ($forum_show = mysql_fetch_array($forum_selects))
			{
			  #$forum_name = mysql_query("SELECT * FROM hosting_forum_group");
			 # while($forum_group_name = mysql_fetch_array($forum_name))
			  #{
				#if ($forum_group_name['hosting_forum_group_id'] == $forum_show['hosting_forum_group_id']) 
				#{
				echo "<table width='900' border='1' align='center' cellpadding='0' cellspacing='0'>";

				echo "<tr><td colspan='6' style='padding: 7px;color:red'>".$forum_show['hosting_forum_group_name']."</td></tr>";
				echo "<tr><td style='white-space: nowrap;' align='center' width='1%'>".$forum_show['hosting_forum_icon']."</td>";
				echo "<td>"."<a href='/?section=forumview&id=".$forum_show['hosting_forum_id']." '>".$forum_show['hosting_forum_title']."</a><br />".$forum_show['hosting_forum_description']."</td>";
				echo "<td width='230'> </td></tr>";
				echo "</table><br>";
				#}
			  }

here is the new code it even doesn't look like at the beginning at all .

 

also i am granting access to website to you

 

http://hostings.flush.ws/?section=forum

user help

pass help22

Link to comment
Share on other sites

I haven't seen a statement of what the problem is?

 

Posting an image of something is kind of pointless (especially if the full size image doesn't load) without a statement of what is wrong in that image. Something might look wrong to you, but looks perfectly fine to everyone else because they don't know what the image is supposed to look like.

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.