title: delete 1 record from a table and automatically delete all records associated with the user_id in mysql
body: <p>I have been trying to learn from reading tutorials online and stuff but I just can't put my finger on it.</p>
  
  <p>I have 2 tables at the moment (i'll have a lot more later on as I build my application) so I want to knock out this issue before expanding and coding.</p>
  
  <p>I have my tables set to use InnoDB and I have each table related to each other by using <code>user_id</code> as foreign keys.</p>
  
  <p>If i issue a <code>DELETE</code> query on the main users table, how can i get all records from other tables that are linked to the <code>user_id</code> field get deleted as well?</p>
  
  <p>I know its simple, but I think I just need to ask the question myself so I can understand the answer rather than reading the answer... heh</p>
  
  <p>thank a lot for any help.</p>