Have a column equal to count of another table?
===

Is there a way to have one column equal the count of all the rows in a different table where the id = a column in the current row? 

For example.

- table1 has the columns: id, count
- table2 has the columns id, table1_id

I want the table1.count to automatically be filled with the amount of rows in table2 where `table2.table1_id = table1.id` 

(its a parent child has one relationship).

Obviously i can just do this with php, i just figured this would be faster than to have to recount this constantly using php every time the page loads. Thanks.