title: simple d3.js relationship graph from mysql table
body: <p>I'm trying to use d3.js to graph relationships from a mysql table. Here is an example table to explain what i'm trying to achieve.</p>
  
  <pre><code>+----+---------+-------+------+
  | id | name    | entry | type |
  +----+---------+-------+------+
  |  1 | ObjectA | 100   | ID1  |
  |  2 | ObjectA | 101   | ID1  |
  |  3 | ObjectB | 101   | ID1  |
  |  4 | ObjectB | 102   | ID1  |
  |  5 | ObjectC | 102   | ID1  |
  |  6 | ObjectC | 100   | ID1  |
  |  7 | ObjectA | 200   | ID2  |
  |  8 | ObjectA | 201   | ID2  |
  |  9 | ObjectB | 201   | ID2  |
  | 10 | ObjectB | 202   | ID2  |
  | 11 | ObjectC | 202   | ID2  |
  | 12 | ObjectC | 200   | ID2  |
  +----+---------+-------+------+
  </code></pre>
  
  <p>ObjectA has ID1 with 101 that connects to ObjectB ID1 of 101<br>
  ObjectB has ID1 with 102 that connects to ObjectC ID1 of 102<br>
  ObjectC has ID1 with 100 that connects to ObjectA ID1 of 100<br></p>
  
  <p>My end goal is to show ObjectA,ObjectB,ObjectC as three seperate circles that are connected to eachother with both blue and red lines representing the ID1 and ID2 relationships.</p>
  
  <p>So far I'm outputting the table to json as recommended widely in videos and stuff i have read. I'm using php for this.</p>
  
  <pre><code>[
  {
      "id": "1",
      "name": "ObjectA",
      "entry": "100",
      "type": "ID1",
  },
  etc..
  </code></pre>
  
  <p>and then reading that from within a html file </p>
  
  <pre><code>d3.json(
    "mysql_table_to_json.php?table=objects",
         function (error, json) {
  then something..
  })
  </code></pre>
  
  <p>the something part i haven't figured out yet.. and i find it really hard to wrap my head around javascript as I'm used to php and python coding myself. i was really really really hoping somone would take pity on me and whip up a little example i could start hacking around.</p>
  
  <p>so any ideas and examples on how to proceed would be very much appreciated.</p>