<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1040684" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1040684</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Another option is if you</title>
    <link>https://www.webmaster-forums.net/web-database-development/mysql-and-php-query-help#comment-1228562</link>
    <description> &lt;p&gt;Another option is if you have a descriptive column in the DB, such as product_name, you might benefit from using those instead of id numbers.&lt;/p&gt;
&lt;p&gt;That way when you are looking at your code it is more clear what you are selecting from the database, rather than remembering what id numbers are for what product or having to view the DB&lt;br /&gt;
i.e. SELECT * WHERE product_name = books, dvd&#039;s&lt;/p&gt;
&lt;p&gt;You can use pretty much anything in the query select to get from the DB. Just make sure you are selecting something that is unique, because it will list everything it finds for the criteria you tell it (unless you know you will be listing dupe results for a specific reason)&lt;/p&gt;
&lt;p&gt;It all depends on what information you are wanting to show. You might want to display your 10 cheapest product prices. Or the first ten members who joined your site. The possibilities are (almost) endless.&lt;/p&gt;
 </description>
     <pubDate>Fri, 15 Feb 2008 18:06:34 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1228562 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>SELECT * FROM `categories`</title>
    <link>https://www.webmaster-forums.net/web-database-development/mysql-and-php-query-help#comment-1228561</link>
    <description> &lt;p&gt;&lt;code&gt;SELECT * FROM `categories` WHERE `id` IN(30,31,33,35);&lt;/code&gt;&#039;&lt;/p&gt;
&lt;p&gt;And to elaborate more to be easier to change:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;?&lt;br /&gt;&amp;nbsp; $goodCats = array(30,31,33,35);&lt;br /&gt;&lt;br /&gt;&amp;nbsp; $sql = &amp;quot;SELECT * FROM `categories` WHERE `id` IN(&amp;quot; . implode(&amp;#039;,&amp;#039;,$goodCats) . &amp;quot;)&amp;quot;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; // get categories&lt;br /&gt;&amp;nbsp; $result = mysql_query($sql);&lt;br /&gt;&amp;nbsp; $count = mysql_num_rows($result);&lt;br /&gt;&amp;nbsp; if($count &amp;gt; 0){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while($row = mysql_fetch_assoc($result)){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $name = $row[&amp;#039;name&amp;#039;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;#039;&amp;#039;.$name.&amp;#039;&amp;#039;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; } else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; print &amp;#039;There are currently 0 categories. Please login to your admin panel to manage categories.&amp;#039;;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;?&amp;gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Fri, 15 Feb 2008 17:08:46 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1228561 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
