<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1018777" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1018777</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-question-0#comment-1110818</link>
    <description> &lt;p&gt;That would explain it! &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Jun 2002 17:27:48 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1110818 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-question-0#comment-1110815</link>
    <description> &lt;p&gt;because  i have 36 forums on my site.. lol&lt;br /&gt;
i will attempt to combine some of the queries later today.&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Jun 2002 16:10:16 +0000</pubDate>
 <dc:creator>korndragon</dc:creator>
 <guid isPermaLink="false">comment 1110815 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-question-0#comment-1110806</link>
    <description> &lt;p&gt;The backend database design is the most important part. The design and efficiency of your backend will determine how efficient your queries can be. For example, it looks like your first 2 queries could have been combined into one if your database design would accomodate it.&lt;/p&gt;
&lt;p&gt;I&#039;m still wondering why you&#039;re getting 90 queries though, even if you&#039;re going in a loop the query should only execute once.&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Jun 2002 12:49:51 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1110806 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-question-0#comment-1110794</link>
    <description> &lt;p&gt;It&#039;s kind of hard to figure out what code is in what page and how you can optimize it. However, I suggest you lear table joins (&lt;a href=&quot;http://www.devshed.com/Server_Side/MySQL/Join/page1.html&quot; class=&quot;bb-url&quot;&gt;http://www.devshed.com/Server_Side/MySQL/Join/page1.html&lt;/a&gt;) as they are extremely helpful.&lt;/p&gt;
&lt;p&gt;By the way, your forum looks very nice. Good job &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Jun 2002 05:26:41 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1110794 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-question-0#comment-1110793</link>
    <description> &lt;p&gt;ok, heres the code that gets all the information from the DB..&lt;/p&gt;
&lt;p&gt;############# Get Forums&#039; Group&#039;s Info #######################&lt;br /&gt;
$sql=$Db1-&amp;gt;query(&quot;SELECT id, title, group_id FROM forum_groups WHERE type=&#039;1&#039; ORDER BY forder&quot;);&lt;br /&gt;
$total_groups=$Db1-&amp;gt;num_rows();&lt;br /&gt;
$x=0;&lt;br /&gt;
while($Db1-&amp;gt;next_record()) {&lt;br /&gt;
	$groups[$x][0] = $Db1-&amp;gt;Record[&#039;id&#039;];&lt;br /&gt;
	$groups[$x][1] = stripslashes($Db1-&amp;gt;Record[&#039;title&#039;]);&lt;br /&gt;
	$groups[$x][2] = $Db1-&amp;gt;Record[&#039;group_id&#039;];&lt;br /&gt;
	$x++;&lt;br /&gt;
}&lt;br /&gt;
$Db1-&amp;gt;free_result($sql);&lt;/p&gt;
&lt;p&gt;###############  Get Forum&#039;s Info ########################&lt;br /&gt;
for($x=0; $x&amp;lt;$total_groups; $x++) {&lt;br /&gt;
	$sql=$Db1-&amp;gt;query(&quot;SELECT id, title, descr, group_id FROM forum_groups WHERE type=&#039;2&#039; AND group_id=&#039;&quot;.$groups[$x][2].&quot;&#039; ORDER BY forder&quot;);&lt;br /&gt;
	$total_forums[$x]=$Db1-&amp;gt;num_rows();&lt;br /&gt;
	$y=0;&lt;br /&gt;
	while($Db1-&amp;gt;next_record()) {&lt;br /&gt;
		$forums[$x][$y][0] = $Db1-&amp;gt;Record[&#039;id&#039;];&lt;br /&gt;
		$forums[$x][$y][1] = stripslashes($Db1-&amp;gt;Record[&#039;title&#039;]);&lt;br /&gt;
		$forums[$x][$y][2] = $Db1-&amp;gt;Record[&#039;descr&#039;];&lt;br /&gt;
		$forums[$x][$y][3] = $Db1-&amp;gt;Record[&#039;group_id&#039;];&lt;br /&gt;
		if($forums[$x][$y][2] != &quot;&quot;) {$forums[$x][$y][2]=&quot;&quot;.$forums[$x][$y][2].&quot;&quot;;}&lt;br /&gt;
		$y++;&lt;br /&gt;
	}&lt;br /&gt;
	$Db1-&amp;gt;free_result($sql);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;################## Get Forum&#039;s Total Threads #################&lt;br /&gt;
for($x=0; $x&amp;lt;$total_groups; $x++) {&lt;br /&gt;
	for($y=0; $y&amp;lt;$total_forums[$x]; $y++) {&lt;br /&gt;
		$sql=$Db1-&amp;gt;query(&quot;SELECT id FROM forum_posts WHERE forum_id=&#039;&quot;.$forums[$x][$y][0].&quot;&#039; and reply=&#039;0&#039;&quot;);&lt;br /&gt;
		$forums[$x][$y][4]=$Db1-&amp;gt;num_rows();&lt;br /&gt;
		$Db1-&amp;gt;free_result($sql);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;################## Get Forum&#039;s Total Threads #################&lt;br /&gt;
for($x=0; $x&amp;lt;$total_groups; $x++) {&lt;br /&gt;
	for($y=0; $y&amp;lt;$total_forums[$x]; $y++) {&lt;br /&gt;
		$sql=$Db1-&amp;gt;query(&quot;SELECT id FROM forum_posts WHERE forum_id=&#039;&quot;.$forums[$x][$y][0].&quot;&#039;&quot;);&lt;br /&gt;
		$forums[$x][$y][5]=$Db1-&amp;gt;num_rows();&lt;br /&gt;
		$Db1-&amp;gt;free_result($sql);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;################## Get Forum&#039;s Last Activity #################&lt;br /&gt;
for($x=0; $x&amp;lt;$total_groups; $x++) {&lt;br /&gt;
	for($y=0; $y&amp;lt;$total_forums[$x]; $y++) {&lt;br /&gt;
		$sql=$Db1-&amp;gt;query(&quot;SELECT id, thread_id, title, dsub, subm, reply FROM forum_posts WHERE forum_id=&#039;&quot;.$forums[$x][$y][0].&quot;&#039; ORDER BY dsub DESC LIMIT 1&quot;);&lt;br /&gt;
		$la[5]=$Db1-&amp;gt;num_rows();&lt;br /&gt;
		if($la[5] != 0) {&lt;br /&gt;
			$Db1-&amp;gt;next_record();&lt;br /&gt;
			$la[0]=$Db1-&amp;gt;Record[&#039;id&#039;];&lt;br /&gt;
			$la[1]=$Db1-&amp;gt;Record[&#039;thread_id&#039;];&lt;br /&gt;
			$la[2]=stripslashes($Db1-&amp;gt;Record[&#039;title&#039;]);&lt;br /&gt;
			$la[3]=date(&#039;F d&#039;, mktime(0,0,$Db1-&amp;gt;Record[&#039;dsub&#039;],1,1,1970));&lt;br /&gt;
			$la[8]=&quot;&quot;.date(&#039;h:i a&#039;, mktime(0,0,$Db1-&amp;gt;Record[&#039;dsub&#039;],1,1,1970)).&quot;&quot;;&lt;br /&gt;
			$la[4]=$Db1-&amp;gt;Record[&#039;subm&#039;];&lt;br /&gt;
			$la[7]=$Db1-&amp;gt;Record[&#039;reply&#039;];&lt;br /&gt;
			$Db1-&amp;gt;free_result($sql);&lt;/p&gt;
&lt;p&gt;			if(strlen($la[2]) &amp;gt; $forumtitlewidth) {&lt;br /&gt;
				$la[2]=substr($la[2], 0, $forumtitlewidth).&quot;...&quot;;&lt;br /&gt;
			}&lt;/p&gt;
&lt;p&gt;			$sql=$Db1-&amp;gt;query(&quot;SELECT username FROM user WHERE userid=&#039;&quot;.$la[4].&quot;&#039;&quot;);&lt;br /&gt;
			$Db1-&amp;gt;next_record();&lt;br /&gt;
			$la[6]=$Db1-&amp;gt;Record[&#039;username&#039;];&lt;br /&gt;
			$Db1-&amp;gt;free_result($sql);&lt;/p&gt;
&lt;p&gt;			if($la[7] == 1) {&lt;br /&gt;
				$sql=$Db1-&amp;gt;query(&quot;SELECT title FROM forum_posts WHERE thread_id=&#039;&quot;.$la[1].&quot;&#039;&quot;);&lt;br /&gt;
				$Db1-&amp;gt;next_record();&lt;br /&gt;
				$la[2]=stripslashes($Db1-&amp;gt;Record[&#039;title&#039;]);&lt;br /&gt;
				$Db1-&amp;gt;free_result($sql);&lt;br /&gt;
			}&lt;br /&gt;
			$forums[$x][$y][7] =	&quot;&lt;a&gt;&quot;.$la[2].&quot;&lt;/a&gt; @ &quot;.$la[3].&quot; &quot;.$la[8].&quot;By &lt;a&gt;&quot;.$la[6].&quot;&lt;/a&gt;&quot;;&lt;br /&gt;
		}&lt;/p&gt;
&lt;p&gt;		if($la[5] == 0) {&lt;br /&gt;
			$forums[$x][$y][7] = &quot;&amp;nbsp;&quot;;&lt;br /&gt;
		}&lt;/p&gt;
&lt;p&gt;	}&lt;br /&gt;
}&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Jun 2002 05:12:07 +0000</pubDate>
 <dc:creator>korndragon</dc:creator>
 <guid isPermaLink="false">comment 1110793 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-question-0#comment-1110792</link>
    <description> &lt;p&gt;i am bettering my skills right now, and learning how to select from more than 1 table at once. i guess i can post the code. its quite a bit though&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Jun 2002 05:10:35 +0000</pubDate>
 <dc:creator>korndragon</dc:creator>
 <guid isPermaLink="false">comment 1110792 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-question-0#comment-1110790</link>
    <description> &lt;p&gt;krondragon, I&#039;m guessing you have some kind of loop and that&#039;s why you get 90 queries for only one page? Maybe we can help you out if you post the lines you are using to retrive information from the database.&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Jun 2002 05:04:55 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1110790 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-question-0#comment-1110788</link>
    <description> &lt;p&gt;yeah, just take a look at &lt;a href=&quot;http://www.newbie-developer.com/?view=forums/index.php&quot; class=&quot;bb-url&quot;&gt;http://www.newbie-developer.com/?view=forums/index.php&lt;/a&gt;&lt;br /&gt;
its mainly just select statements.&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Jun 2002 01:26:06 +0000</pubDate>
 <dc:creator>korndragon</dc:creator>
 <guid isPermaLink="false">comment 1110788 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/sql-question-0#comment-1110786</link>
    <description> &lt;p&gt;If you are talking about 90 queries to get one bit of info, then it is pretty excessive. I am also assuming that by a query that you mean a &lt;strong&gt;SELECT&lt;/strong&gt; statement. You might provide a little more info to us on what you mean by queries and what kind of info you are trying to get and your table relationships.&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Jun 2002 01:16:42 +0000</pubDate>
 <dc:creator>mairving</dc:creator>
 <guid isPermaLink="false">comment 1110786 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
