title: Order child rows after parent row
body: <p>I have a MySQL database with a table that contains data like so:</p>
  
  <pre><code>ID | name    | data  | ParentId
  1  | somename| 435   | 0
  2  | name2   | sample| 0
  3  | child   | sample| 1
  ...
  </code></pre>
  
  <p>I am trying to write a query that gets me all the data from this table and places each child/children after its parent.</p>
  
  <p>Example: </p>
  
  <pre><code>1. somename | 435
  1.1. child  | sample
  ...
  </code></pre>
  
  <p>Is that possible? If not with a query, can I do it with PHP (it's what I'm using for my back-end).</p>
  
  <p>Thanks in advance. </p>