<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1022335" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1022335</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/using-more-one-table-mysql#comment-1137710</link>
    <description> &lt;p&gt;Awesome.  Thanks.  That&#039;ll REALLY help me out a lot.  That join stuff is new to me but I&#039;ll look up more info on that.  I do however have a few small follow up questions about that redoing the table structures.&lt;/p&gt;
&lt;p&gt;I get the renaming league_organization and league_eligibility to org_id and elig_id to match the fields in the two other tables.  But I only half understand the INDEX(org_id),INDEX(elig_id).  I&#039;m making these tables via phpMyAdmin.  Does that just mean to hit that &quot;index&quot; link on that field&#039;s row when looking at the table structure?  Nothing else other than click that link for each of the two new fields?&lt;/p&gt;
&lt;p&gt;One side questions:  What program or program type do people use to make mySQL databases with commands (not using a browser based script)?  I&#039;m assuming that&#039;s the style you were using to explain what I should do.   &lt;/p&gt;
&lt;p&gt;Oh, one other side question:  This isn&#039;t about structure, but what if one of my leagues offers both Open/Public (elig_id=1) AND Private (elig_id=2) or any similar situation where I need multiples?  Will that screw up the way I&#039;m doing this now?  Am I going down the wrong road?&lt;/p&gt;
&lt;p&gt;Thanks a ton again.&lt;/p&gt;
&lt;p&gt;---------------------&lt;/p&gt;
&lt;p&gt;Since posting this, just letting everybody know about a good article I found.  I doesn&#039;t go too much into the php coding but it&#039;s pretty good at explaining normalization concepts.  &lt;a href=&quot;http://www.phpbuilder.com/columns/barry20000731.php3&quot; class=&quot;bb-url&quot;&gt;http://www.phpbuilder.com/columns/barry20000731.php3&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Sep 2003 17:07:32 +0000</pubDate>
 <dc:creator>fifeclub</dc:creator>
 <guid isPermaLink="false">comment 1137710 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/using-more-one-table-mysql#comment-1137709</link>
    <description> &lt;p&gt;first replace the league_organization and league_eligibility fields in your leagues table with id fields, and index them  so your table looks something like this:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;table leagues (&lt;br /&gt;	league_id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,&lt;br /&gt;	league_name VARCHAR,&lt;br /&gt;	league_city VARCHAR,&lt;br /&gt;	league_state VARCHAR,&lt;br /&gt;	org_id INTGER UNSIGNED NOT NULL,&lt;br /&gt;	elig_id INTEGER UNSIGNED NOT NULL,&lt;br /&gt;	INDEX(org_id),&lt;br /&gt;	INDEX(elig_id)&lt;br /&gt;);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;and your other tables look like this:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;table organization (&lt;br /&gt;	org_id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,&lt;br /&gt;	org_type VARCHAR NOT NULL&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;table eligibility (&lt;br /&gt;	elig_id INTEGER UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,&lt;br /&gt;	elig_type VARCHAR NOT NULL&lt;br /&gt;);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;now you can join your tables based on these ids.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;SELECT l.*, o.org_type, e.elig_type&lt;br /&gt;FROM leagues AS l&lt;br /&gt;LEFT JOIN organization AS o ON l.org_id=o.org_id&lt;br /&gt;LEFT JOIN eligibility AS e ON l.elig_id=e.elig_id&lt;br /&gt;ORDER BY l.league_name ASC&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;a LEFT JOIN will return all records from the left table, and matched records from the right table or NULL values if not found&lt;br /&gt;
an INNER JOIN will only return records from the left table which have matching records in right table&lt;/p&gt;
&lt;p&gt;so the above example will return a list of all leagues, along with their org_type and elig_type if they have one, but replacing LEFT JOIN with INNER JOIN will only return leagues that have both an org_type and elig_type&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Sep 2003 16:24:41 +0000</pubDate>
 <dc:creator>ROB</dc:creator>
 <guid isPermaLink="false">comment 1137709 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
