title: PHP: Split results of query into 2 columns
body: <p>I want to load contacts from a query, Whilst I have found ways to split by the amount of rows I want the result to be split into two columns as below as well as them being a sort of clickable button.Is it possible to display the query results as described below by the use of HTML or by the query itself? :</p>
  
  <pre><code>Contacts
  ------------------------------
  Albert Smith   | Ben Marshall
  Benjamin Jones | Chris Jones
  </code></pre>
  
  <p>I have tried the code below</p>
  
  <pre><code>&lt;? 
  $rowcount = mysql_num_rows($records);
  echo "&lt;div id='column1'&gt;";
  $i = 0;
  while ($d = mysql_fetch_object($records)) {
    echo $d-&gt;name;
    $i++;
  
    if ($i == floor($rowcount / 2)) {
        echo "&lt;/div&gt;&lt;div id='colums2'&gt;";
    }
  }
  echo "&lt;/div&gt;";
  ?&gt;
  </code></pre>
  
  <p>But this splits the columns by reaching half of the results in 1 column and the rest in another column</p>
  
  <p>Albert Smith | Benjamin Jones </p>
  
  <p>Ben Marshall | Chris Jones</p>