<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1028491" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1028491</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/display-results-tables#comment-1168070</link>
    <description> &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;define&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;NUM_COLS\&quot;, 4);&lt;br /&gt;&lt;br /&gt;echo \&quot;&amp;lt;table border=&#039;1&#039;&amp;gt; \n\&quot;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$col&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = 1;&lt;br /&gt;foreach (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$items&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; as &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$item&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$col&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; == 1) echo \&quot;\t&amp;lt;tr&amp;gt;\&quot;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo \&quot; &amp;lt;td&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$item&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;/td&amp;gt; \&quot;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (++&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$col&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; == 4) { echo \&quot;&amp;lt;/tr&amp;gt;\n\&quot;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$col&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = 1; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;echo \&quot;&amp;lt;/table&amp;gt; \n\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 17 Mar 2005 12:23:26 +0000</pubDate>
 <dc:creator>thisnew</dc:creator>
 <guid isPermaLink="false">comment 1168070 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/display-results-tables#comment-1167848</link>
    <description> &lt;p&gt;I think you should use a while loop!&lt;/p&gt;
 </description>
     <pubDate>Mon, 14 Mar 2005 07:12:06 +0000</pubDate>
 <dc:creator>naoshad</dc:creator>
 <guid isPermaLink="false">comment 1167848 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/display-results-tables#comment-1167826</link>
    <description> &lt;p&gt;Well, this actually made me find out something interesting. Ceil and Round convert values to float, and you have to use intval to convert them back to intergers:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;?&lt;br /&gt;$NUMBER_OF_ROWS = 4; // number &lt;br /&gt;$num = count($what_to_count);&lt;br /&gt;$n = 0;&lt;br /&gt;$num_cols = intval(ceil($num/$NUMBER_OF_ROWS)); &lt;br /&gt;echo $num_cols;&lt;br /&gt;echo &amp;#039;&amp;lt;table border=&amp;quot;1&amp;quot;&amp;gt;&amp;#039;; &lt;br /&gt;while($n &amp;lt; $num)&lt;br /&gt;	{&lt;br /&gt;	$i = ($n/$num_cols) * 1;&lt;br /&gt;	$j = (($n+1)/$num_cols) * 1;&lt;br /&gt;	if(is_int($i)){&lt;br /&gt;		echo &amp;quot;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;quot;;&lt;br /&gt;	}else{&lt;br /&gt;		echo &amp;quot;&amp;lt;td&amp;gt;&amp;quot;;&lt;br /&gt;		}&lt;br /&gt;	echo &amp;quot;Data ($n)&amp;quot;;&lt;br /&gt;	if(is_int(($j)/$num_cols)){&lt;br /&gt;		echo &amp;quot;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;quot;;&lt;br /&gt;	}else{&lt;br /&gt;		echo &amp;quot;&amp;lt;/td&amp;gt;&amp;quot;;&lt;br /&gt;		}&lt;br /&gt;	echo &amp;quot;\n&amp;quot;;&lt;br /&gt;	$n++;&lt;br /&gt;	}&lt;br /&gt;?&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Sun, 13 Mar 2005 23:45:12 +0000</pubDate>
 <dc:creator>CptAwesome</dc:creator>
 <guid isPermaLink="false">comment 1167826 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/display-results-tables#comment-1167825</link>
    <description> &lt;p&gt;Thanks for the replies,&lt;br /&gt;
So far my script does the actions but is abit backwards.&lt;br /&gt;
I do need the results side by side, about 4 columns wide/ ?deep.&lt;/p&gt;
&lt;p&gt;$NUMBER_OF_ROWS = 4; // number&lt;br /&gt;
$lines = file(&#039;/rars.data&#039;);&lt;br /&gt;
$num = count($lines);&lt;br /&gt;
$num_cols = ceil($num/$NUMBER_OF_ROWS);&lt;br /&gt;
echo &#039;&#039;;&lt;br /&gt;
for($row = 0; $row &amp;lt; $NUMBER_OF_ROWS; $row++){&lt;br /&gt;
    echo &#039;&#039;;&lt;br /&gt;
    for($col = 0; $col &amp;lt; $num_cols; $col++){&lt;br /&gt;
        $n = $num_cols*$row + $col;&lt;br /&gt;
        if($num &amp;lt;= $n){&lt;br /&gt;
            $result = &#039;&amp;nbsp;&#039;;&lt;br /&gt;
        } else {&lt;br /&gt;
            $parts = explode(&#039;|&#039;, $lines[$n]);&lt;br /&gt;
            $result = &#039;&lt;a href=&quot;r.&amp;#039;.$parts[0].&amp;#039;.html/&amp;#039;.$parts[0].&amp;#039;/&amp;#039;.$parts[2].&amp;#039;&quot;&gt;&#039;.$parts[1].&#039;&lt;/a&gt;&#039;;&lt;br /&gt;
        }&lt;br /&gt;
        echo &#039;&#039;.$result.&#039;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    echo &#039;&#039;;&lt;br /&gt;
}&lt;br /&gt;
echo &#039;&#039;;&lt;/p&gt;
&lt;p&gt;However, my script is not displaying the right structure or results.&lt;/p&gt;
&lt;p&gt;1. It is not using the URL explode and search function to get my results.&lt;br /&gt;
list($first) = explode(&#039;/&#039;, substr($PATH_INFO,1));&lt;br /&gt;
if ($parts[2] == $first) { &lt;/p&gt;
&lt;p&gt;ex. &lt;a href=&quot;http://url.com/orders.php/Paid&quot; class=&quot;bb-url&quot;&gt;http://url.com/orders.php/Paid&lt;/a&gt;&lt;br /&gt;
Paid in the URL is &quot;$first&quot;&lt;br /&gt;
Paid is also &quot;$parts[2]&quot;&lt;/p&gt;
&lt;p&gt;2. All my results are showing one-after-the-other across, making the page to wide.&lt;/p&gt;
&lt;p&gt;Any help on this matters is surely appreciated.&lt;/p&gt;
 </description>
     <pubDate>Sun, 13 Mar 2005 23:02:36 +0000</pubDate>
 <dc:creator>rayzun</dc:creator>
 <guid isPermaLink="false">comment 1167825 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/display-results-tables#comment-1167782</link>
    <description> &lt;p&gt;if(is_int($count_td / 4))&lt;br /&gt;
 {&lt;br /&gt;
 echo &quot;\n&quot;;&lt;br /&gt;
 }&lt;/p&gt;
 </description>
     <pubDate>Sun, 13 Mar 2005 01:42:13 +0000</pubDate>
 <dc:creator>CptAwesome</dc:creator>
 <guid isPermaLink="false">comment 1167782 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/display-results-tables#comment-1167776</link>
    <description> &lt;p&gt;just add echo &quot;&quot;; above the other echo and echo &quot;&quot;; after it, although this would create 1000 table cells :eek: so depending on how many you wanted across you could do another $count_td so if $count_td == amount wide echo a  which will create columns.&lt;br /&gt;
Thats the easy way, if you wanted it listed downwards in one column then again in another column beside it you have to use a nested table and a bit of math.  get the result, divide by two and then echo the end of the nested table then the  of the main table then the begining of the second nested table until you get to the end then finish off the tables.&lt;/p&gt;
 </description>
     <pubDate>Sat, 12 Mar 2005 22:45:14 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1167776 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
