title: MySQL, php table question (delete on an update)
body: <p>I have the two following tables </p>
  
  <pre><code>table A
  
  | id | name |
  | 1  | bob |
  | 2  | jill |
  | 3  | jojo |
  </code></pre>
  
  <p>Table A is displayed by using checkboxes.</p>
  
  <p>On the first go, the user checks all three checkboxes so you get the result in table B.</p>
  
  <pre><code>table B
  
  | table_a_id | table_c_id |
  | 1          |   2        |
  | 2          |   2        |
  | 3          |   2        |
  </code></pre>
  
  <p>But the next time the user goes to edit, they UNCHECK '2' so that it's only:</p>
  
  <pre><code>1
  3
  </code></pre>
  
  <p>How do I write my query (using either mySQL or php) so that TABLE B is updated to:</p>
  
  <pre><code>| table_a_id | table_c_id |
  | 1          |   2        |
  | 3          |   2        |
  </code></pre>