<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1034851" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1034851</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/creating-2-column-results-mysql-php#comment-1202372</link>
    <description> &lt;p&gt;myarray=array();&lt;/p&gt;
&lt;p&gt;should be &lt;/p&gt;
&lt;p&gt;$myarray=array();&lt;/p&gt;
&lt;p&gt;(needs the dollar sign) but really that bit and the following bit&lt;/p&gt;
&lt;p&gt;myarray+=array($j=&amp;gt;array(&#039;category_id&#039;=&amp;gt;category_id, &#039;category_name&#039;=&amp;gt;category_name, &#039;cat_description&#039;=&amp;gt;cat_description));&lt;/p&gt;
&lt;p&gt;can/should be removed as they aren&#039;t doing anything, the results are coming from the database query loop.&lt;/p&gt;
&lt;p&gt;If you leave it, the myarray+= needs a dollar sign too.&lt;br /&gt;
just comment it out for now even&lt;/p&gt;
&lt;p&gt;// single line comment&lt;br /&gt;
/* multi&lt;br /&gt;
line&lt;br /&gt;
comment */&lt;br /&gt;
# to end of line comment (not recommend if you edit in different editors)&lt;/p&gt;
 </description>
     <pubDate>Sat, 17 Jun 2006 11:01:13 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1202372 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/creating-2-column-results-mysql-php#comment-1202370</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;&lt;strong&gt;mairving wrote:&lt;/strong&gt; Looks like the while loop was opened { but not closed }.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;no it does have closure it is just below the last line in the code above. &lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;this is not easy like some people say &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/sad.png&quot; title=&quot;Sad&quot; alt=&quot;Sad&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Sat, 17 Jun 2006 09:59:53 +0000</pubDate>
 <dc:creator>mullet</dc:creator>
 <guid isPermaLink="false">comment 1202370 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/creating-2-column-results-mysql-php#comment-1202342</link>
    <description> &lt;p&gt;Looks like the while loop was opened { but not closed }.&lt;/p&gt;
 </description>
     <pubDate>Sat, 17 Jun 2006 02:10:39 +0000</pubDate>
 <dc:creator>mairving</dc:creator>
 <guid isPermaLink="false">comment 1202342 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/creating-2-column-results-mysql-php#comment-1202332</link>
    <description> &lt;p&gt;the highlighted line below is causing a pharse error now...&lt;/p&gt;
&lt;p&gt;Parse error: parse error, unexpected &#039;=&#039; in /**/**/**/**/**/**/**/index.php on line 31&lt;/p&gt;
&lt;p&gt;been sat here looking at other scripts and example sites and still cant figure this one out..&lt;/p&gt;
&lt;p&gt;---------------------------------------------------------------------&lt;br /&gt;
if (!$result==1) {&lt;br /&gt;
echo &quot;DB Error, could not query the database\n&quot;;&lt;br /&gt;
echo &#039;MySQL Error: &#039; . mysql_error();&lt;br /&gt;
exit;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;while ($gal = mysql_fetch_assoc($result)) {&lt;br /&gt;
[****line 31***]myarray=array();[***line 31***]]&lt;br /&gt;
myarray+=array($j=&amp;gt;array(&#039;category_id&#039;=&amp;gt;category_id, &#039;category_name&#039;=&amp;gt;category_name, &#039;cat_description&#039;=&amp;gt;cat_description));&lt;/p&gt;
&lt;p&gt;echo &quot;&lt;strong&gt;&lt;a&gt;&lt;/a&gt;&lt;/strong&gt;&quot;;&lt;br /&gt;
echo $gal[&#039;category_name&#039;];&lt;br /&gt;
echo &quot;&quot;;&lt;br /&gt;
echo nl2br($gal[&#039;cat_description&#039;]);&lt;br /&gt;
echo &quot;&quot;;&lt;br /&gt;
------------------------------------------------------------------&lt;/p&gt;
 </description>
     <pubDate>Sat, 17 Jun 2006 00:25:16 +0000</pubDate>
 <dc:creator>mullet</dc:creator>
 <guid isPermaLink="false">comment 1202332 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/creating-2-column-results-mysql-php#comment-1202328</link>
    <description> &lt;p&gt;Some of the code above you dont need&lt;/p&gt;
&lt;p&gt;if (file_exists(&#039;../library/opendb.php&#039;)) {&lt;br /&gt;
include(&quot;../library/opendb.php&quot;);&lt;br /&gt;
} else {&lt;br /&gt;
include(&quot;library/opendb.php&quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;strong&gt;$ASC = &#039;ASC&#039;;&lt;/strong&gt;&lt;br /&gt;
$query=&quot;SELECT * FROM gallery_category ORDER BY category_name ASC&quot;;&lt;br /&gt;
$result=mysql_query($query);&lt;/p&gt;
&lt;p&gt;if (!$result==1) {&lt;br /&gt;
echo &quot;DB Error, could not query the database\n&quot;;&lt;br /&gt;
echo &#039;MySQL Error: &#039; . mysql_error();&lt;br /&gt;
exit;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;while ($gal = mysql_fetch_assoc($result)) {&lt;br /&gt;
myarray=array();&lt;br /&gt;
&lt;strong&gt;$j=1;&lt;br /&gt;
while (next-record-loop)&lt;br /&gt;
{&lt;/strong&gt;&lt;br /&gt;
myarray+=array($j=&amp;gt;array(&#039;category_id&#039;=&amp;gt;category_id, &#039;category_name&#039;=&amp;gt;category_name, &#039;cat_description&#039;=&amp;gt;cat_description));&lt;br /&gt;
&lt;strong&gt;$j++;&lt;br /&gt;
}&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I have made the extra bits bold. you don&#039;t need the inner while loop. if you want to limit the results, say you have 100 items in your database but only want 10, you&#039;d use limit and even offset&lt;/p&gt;
&lt;p&gt;LIMIT 10 // gets first ten results&lt;br /&gt;
LIMIT 5,10 // gets 5 results starting at 10 (really 9 as mysql starts at 0)&lt;/p&gt;
 </description>
     <pubDate>Fri, 16 Jun 2006 22:36:48 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1202328 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
