title: Setting up foreign keys in phpMyAdmin?
body: <p>I'm setting up a database using phpMyAdmin. I have two tables (<code>foo</code> and <code>bar</code>), <strong>indexed on their primary keys</strong>. I am trying to create a relational table (<code>foo_bar</code>) between them, using their primary keys as foreign keys.</p>
  <p>I created these tables as MyISAM, but have since changed all three to InnoDB, because I read that MyISAM doesn't support foreign keys. All <code>id</code> fields are <code>INT(11)</code>.</p>
  <p>When I choose the <code>foo_bar</code> table, click the &quot;relation view&quot; link, and try to set the FK columns to be <code>database.foo.id</code> and <code>database.bar.id</code>, it says <strong>&quot;No index defined!&quot;</strong> beside each column.</p>
  <p>What am I missing?</p>
  <h2>Clarification/Update</h2>
  <p>For the sake of simplicity, I want to keep using phpMyAdmin. I am currently using XAMPP, which is easy enough to let me focus on the PHP/CSS/Javascript, and it comes with phpMyAdmin.</p>
  <p>Also, although I haven't been able to set up explicit foreign keys yet, I do have a relational table and can perform joins like this:</p>
  <pre><code>SELECT * 
  FROM foo 
  INNER JOIN foo_bar 
  ON foo.id = foo_bar.foo_id 
  INNER JOIN bar
  ON foo_bar.bar_id = bar.id;
  </code></pre>
  <p>It just makes me uncomfortable not to have the FKs explicitly defined in the database.</p>