<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1023275" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1023275</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143620</link>
    <description> &lt;p&gt;as of now, it&#039;s 8:53 pm 12/31/2003 for me..... how&#039;s the weather tomorrow? &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>Thu, 01 Jan 2004 01:50:10 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1143620 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143617</link>
    <description> &lt;p&gt;I think I&#039;m missing something here, either that or I am still in last year &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Give me a couple of days (have to recover from 2003 and have gallery display tomorrow), I&#039;ll try upload a few things, a working, or semi working example might help.&lt;/p&gt;
&lt;p&gt;Thanks all, happy new year&lt;/p&gt;
&lt;p&gt;[edit extra] I got it working, used a combination of stuff I&#039;d posted (in different order) and it works, probably not the best way to do it or the cleaniest but it works &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;
&lt;p&gt;Thanks to all that helped[/edit]&lt;/p&gt;
&lt;p&gt;[edit] Tomorrow was hot, so hot i got a case of sunstroke, we live and learn [/edit]&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Dec 2003 22:41:56 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1143617 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143609</link>
    <description> &lt;p&gt;Semi-similarly, I was thinking about joining them....&lt;/p&gt;
&lt;p&gt;Using m3rajk&#039;s tables:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;SELECT qna.*,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; comments.cid, comments.comment, comments.commauth, comments.commpostdate&lt;br /&gt;FROM qna&lt;br /&gt;LEFT JOIN comments ON qna.qid=comments.qid&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// table&lt;br /&gt;// tr td table header /td /tr&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$last_qid &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;while (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$q&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_fetch_array&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// new question?&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$q&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$last_qid&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// tr td $q[question] /td /tr&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // tr td $q[answer] /td /tr&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$q&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;comment&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]!==&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// tr td comment /td /tr&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// or comments for previous question?&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// tr td comment /td /tr&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Dec 2003 15:31:37 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1143609 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143599</link>
    <description> &lt;p&gt;for pagination, how about these tables:&lt;/p&gt;
&lt;p&gt;table q&amp;amp;a&lt;/p&gt;
&lt;p&gt;qid&lt;br /&gt;
question&lt;br /&gt;
answer&lt;br /&gt;
qauth&lt;br /&gt;
aauth&lt;br /&gt;
qpostdate&lt;br /&gt;
apostdate&lt;/p&gt;
&lt;p&gt;table comments&lt;br /&gt;
cid&lt;br /&gt;
qid&lt;br /&gt;
comment&lt;br /&gt;
commauth&lt;br /&gt;
commpostdate&lt;/p&gt;
&lt;p&gt;and the script has this basic outline:&lt;/p&gt;
&lt;p&gt;connect to sql&lt;br /&gt;
find the start point for the page&lt;br /&gt;
while you get the questions for the page&lt;br /&gt;
split qid to a variable&lt;br /&gt;
format question and possible answer&lt;br /&gt;
start new table cell that scroll the overflow for the comments&lt;br /&gt;
using the qid, find all comments with the qid&lt;br /&gt;
while retrieveing the comments (in order by cid)&lt;br /&gt;
put the comments in the comment cell&lt;br /&gt;
end inner for loop&lt;br /&gt;
close out question table&lt;br /&gt;
end outer for loop&lt;br /&gt;
display data&lt;/p&gt;
&lt;p&gt;only possible issue is that each question is a table in that senario, possibly with an inner table for the comments.&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Dec 2003 12:55:31 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1143599 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143588</link>
    <description> &lt;p&gt;I looked at 2 tables, slightly differently thou, table1 questions and table 2 answers and comments.&lt;br /&gt;
But the same problem exists.&lt;br /&gt;
It&#039;s hard to explain it seems, but anyway I try this I&#039;m always left with an array being printed (echo&#039;d) to the screen in some sort of loop, to which I can&#039;t compare to the results of the 2 arrays loop.&lt;/p&gt;
&lt;p&gt;this has been driving me crazy so if it makes no sense its just me going nuts&lt;/p&gt;
&lt;p&gt;what I need is impossible I am beginning to think.&lt;br /&gt;
my latest angle is I need the results of the above mentioned (first few posts) loop sorted into seperate variables (not in an array) and compared to the array in the second loop but then it would entail a whole heap of checks.&lt;/p&gt;
&lt;p&gt;if a value in loop 2 equals a value in loop 1 variable equals true - sounds pretty easy, BUT then if there are more than one for each value it should  only display one but count the amount - confused? I am.&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Dec 2003 07:38:47 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1143588 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143572</link>
    <description> &lt;p&gt;i&#039;m in agreement with mark. i was hoping it was me faling outta touch since i had been recovering for a little more than two weeks and did no scripting for about 3 and a half while diagnosing and restoring the comp to a point i could recover data. &lt;/p&gt;
&lt;p&gt;if i have it correct you have an easy way to break up the data to two tables and then to display what you want&lt;br /&gt;
table1: q&amp;amp;a&lt;br /&gt;
table2: comments&lt;/p&gt;
&lt;p&gt;each q has a id number. using the id number you look up the comments.&lt;/p&gt;
&lt;p&gt;two calls.&lt;/p&gt;
&lt;p&gt;call one gets the informationon the q&amp;amp;a table. call two is  part of the display fuformating function, it queries for associated comments and then adds that to the question and possible answer.&lt;/p&gt;
&lt;p&gt;then again, i might be completely off in what i think you&#039;re asking for.&lt;/p&gt;
 </description>
     <pubDate>Wed, 31 Dec 2003 01:42:17 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1143572 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143561</link>
    <description> &lt;p&gt;I&#039;m having a hard time wrapping my head around this.&lt;/p&gt;
&lt;p&gt;I&#039;m also wondering if this project may be easier with multiple tables.&lt;/p&gt;
 </description>
     <pubDate>Tue, 30 Dec 2003 22:24:58 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1143561 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143553</link>
    <description> &lt;p&gt;one answer per question and the comments are just thrown in there, not directly related (via code or numbers) to any questions or answers.&lt;/p&gt;
&lt;p&gt;Q. what colour is the sky?&lt;br /&gt;
A. the sky is blue&lt;br /&gt;
C. there are also clouds in the sky&lt;br /&gt;
Q. are there clouds in the sky?&lt;br /&gt;
A. I just said that, read the comment&lt;br /&gt;
Q. Is it raining&lt;br /&gt;
...&lt;/p&gt;
&lt;p&gt;can&#039;t answer if no question is there, so use comments instead.&lt;/p&gt;
 </description>
     <pubDate>Tue, 30 Dec 2003 21:54:36 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1143553 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143538</link>
    <description> &lt;p&gt;can a question have more than one comment?&lt;/p&gt;
&lt;p&gt;This is what I&#039;m thinking right now:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;CREATE TABLE `tmp` (&lt;br /&gt;&amp;nbsp; `req_item` int(10) unsigned NOT NULL auto_increment,&lt;br /&gt;&amp;nbsp; `req_owner` mediumint(8) unsigned NOT NULL default &amp;#039;0&amp;#039;,&lt;br /&gt;&amp;nbsp; `req_user` mediumint(8) unsigned NOT NULL default &amp;#039;0&amp;#039;,&lt;br /&gt;&amp;nbsp; `req_text` blob NOT NULL,&lt;br /&gt;&amp;nbsp; `req_date` int(10) unsigned NOT NULL default &amp;#039;0&amp;#039;,&lt;br /&gt;&amp;nbsp; `req_num` smallint(5) unsigned NOT NULL default &amp;#039;0&amp;#039;,&lt;br /&gt;&amp;nbsp; `req_type` char(1) NOT NULL default &amp;#039;&amp;#039;,&lt;br /&gt;&amp;nbsp; PRIMARY KEY&amp;nbsp; (`req_item`,`req_owner`,`req_user`,`req_type`),,&lt;br /&gt;&amp;nbsp; KEY `req_item` (`req_item`)&lt;br /&gt;&amp;nbsp; KEY `req_type` (`req_type`)&lt;br /&gt;) TYPE=MyISAM&lt;/code&gt;&lt;/div&gt;&#039;&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;SELECT &lt;br /&gt;	q.req_item AS q_item,&lt;br /&gt;	q.req_owner AS q_owner,&lt;br /&gt;	q.req_user AS q_user,&lt;br /&gt;	q.req_text AS q_text,&lt;br /&gt;	q.req_date AS q_date,&lt;br /&gt;	q.req_num AS q_num,&lt;br /&gt;	a.req_text AS a_text,&lt;br /&gt;	a.req_date AS a_date&lt;br /&gt;	c.req_text AS c_text,&lt;br /&gt;	c.req_date AS c_date&lt;br /&gt;FROM item_request AS q&lt;br /&gt;	LEFT JOIN item_request AS a ON (p.req_item=a.req_item AND a.req_type=&amp;#039;a&amp;#039;)&lt;br /&gt;	LEFT JOIN item_request AS c ON (p.req_item=a.req_item AND a.req_type=&amp;#039;c&amp;#039;)&lt;br /&gt;WHERE q.req_type=&amp;#039;q&amp;#039;&lt;br /&gt;ORDER BY q.req_item DESC&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Tue, 30 Dec 2003 18:20:31 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1143538 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/sortingdisplaying-results#comment-1143426</link>
    <description> &lt;p&gt;unfortunately the hd crash i had has had me recovering from that for the better part of a month, so i&#039;m not quite back to form&lt;/p&gt;
 </description>
     <pubDate>Sun, 28 Dec 2003 21:56:19 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1143426 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
