Note that there are some explanatory texts on larger screens.

plurals
  1. POWhile loop into 2 different divs?
    primarykey
    data
    text
    <p>I've got an about page, and two HTML columns and I want to while loop the contents of my mysql query into BOTH columns, even though they are defined as two different divs. What I was thinking of doing is somehow dividing the amount of rows in the mysql database by 2, and then showing half and half, but I'm not sure how to do this (specifically doing the half and half mysql queries)</p> <p>Could someone please either show me how I can halve a mysql database into two parts, or come up with a better solution to my problem? Thankyou :).</p> <p>EDIT: </p> <pre><code>&lt;?php $djs_all_db = mysql_query("SELECT * FROM djs") or die(mysql_error()); while($djs_all = mysql_fetch_array( $djs_all_db )) { echo " &lt;div class="row"&gt; &lt;!--It does it once here--&gt; &lt;div class=\"column column-2\"&gt; &lt;img src=\"images/about/" . $djs['username'] . "-profile.png\" alt=\"Profile\" class=\"profile-image\"/&gt; &lt;p class=\"float-left\"&gt;&lt;strong&gt;" . $djs['realname'] . "&lt;/strong&gt;&lt;/p&gt; &lt;p class=\"float-right\"&gt;&lt;a href=\"#\" title=\"\"&gt;" . $djs['twitterusername'] . "&lt;/a&gt;&lt;/p&gt; &lt;div class=\"clear\"&gt;&lt;/div&gt; &lt;p&gt;" . $djs['biography'] . "&lt;/p&gt; &lt;/div&gt; &lt;!--but now for column 2?--&gt; &lt;div class=\"column column-3\"&gt; &lt;img src=\"images/about/profile.png\" alt=\"Profile\" class=\"profile-image\"/&gt; &lt;p class=\"float-left\"&gt;&lt;strong&gt;Edward Smith, Developer&lt;/strong&gt;&lt;/p&gt; &lt;p class=\"float-right\"&gt;&lt;a href=\"#\" title=\"\"&gt;Twitter&lt;/a&gt;&lt;/p&gt; &lt;div class=\"clear\"&gt;&lt;/div&gt; &lt;p&gt;In tellus arcu, luctus sed vulputate ut, dictum sed nisi. Suspendisse commodo, enim sed mollis cursus, urna quam laoreet velit, vel sollicitudin arcu augue at quam.&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--/.row--&gt;" ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload