title: How to write football ranking system algorithm
body: <p>I'm now developing football website and trying to write coding for ranking table. I feel that there must be algorithm to develop ranking table as follow.</p>
  
  <p><img src="https://i.stack.imgur.com/1QZkY.jpg" alt="enter image description here"></p>
  
  <p>And table structure is,</p>
  
  <pre><code>tb_result
  -   matchno
  -   team1
  -   team2
  -   score1
  -   score2
  </code></pre>
  
  <p>And I'll input data just like</p>
  
  <pre><code>Matchno team1       team2       score1      score2
  1       A-Team      B-Team          1       3
  1       C-Team      D-Team          3       0
  2       D-Team      A-Team          3       3
  2       B-Team      C-Team          2       5   
  </code></pre>
  
  <p>So I'd like to know any algorithm or formula can be developed to get ranking table. </p>