Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>&lt;?php $row = array(); $rowCount = $mysql_row_count($result); while ($row[] = mysql_fetch_array($result)); echo "&lt;div idi\"leftcol\"&gt;"; for ($i = 0; $i &lt; $rowCount; $i+=2) echo $row[$i]; //Change this to whatever you want to echo or however you want to echo it echo "&lt;/div&gt;"; echo "&lt;div idi\"rightcol\"&gt;"; for ($i = 1; $i &lt; $rowCount; $i+=2) echo $row[$i]; //Change this to whatever you want to echo or however you want to echo it echo "&lt;/div&gt;"; ?&gt; </code></pre> <p><strong>EDIT</strong></p> <p>Here's what i came up with your code... I'm not sure if it will work right away since i haven't tested it. But I hope it gives you an idea of how to do it now.</p> <pre><code>&lt;?php function echoData($right, $row, $rowCount) { for ($i = $right; $i &lt; $rowCount; $i += 2) { $lcol = $lcol + 1; $vis = 0; $uri = substr($row[$i][1], 0, strpos($row[$i][1], "&amp;")); $sql = "SELECT * FROM `readart` WHERE `url`=\"".$uri."\""; $result2 = mysql_query($sql); while($row2 = mysql_fetch_assoc($result2)) { $vis = $row2['visits']; } $tit = myTruncate2($row[$i][4], 91); echo '&lt;div class="newitem"&gt;'; echo '&lt;img style="float:left;margin:6px;margin-right:20px;" src="newslogo/'.$row[$i][2].'.png" width="40px" height="40px" /&gt;'; echo '&lt;span id="header"&gt;'.$tit.'&lt;/span&gt;&lt;br&gt;'; //echo $row[6]; echo '&lt;span id="date"&gt;'.date("D, j F g:i A", $row[$i][6]); if($vis &gt; 0){echo ' - Viewed '.$vis.' times';} echo '&lt;/span&gt;&lt;hr&gt;'; echo '&lt;p id="textbody"&gt;'; echo $row[$i][5]; echo '&lt;br&gt;&lt;br&gt;&lt;a href="recordarticles.php?url='.$row[$i][1].'" target="_blank"&gt;Read More&lt;/a&gt;'; echo '&lt;/p&gt;&lt;br&gt;&lt;/div&gt;'; } } **Here you should put the query code** $sql = "SELECT e.t.c e.t.c"; $result = mysql_query($sql); $rowCount = mysql_num_rows(result); $row = array(); while($row[] = mysql_fetch_array($result)); echo "&lt;div id='leftside'&gt;"; echoData(0, $row, $rowCount); echo "&lt;/div&gt;"; echo "&lt;div id='rightside'&gt;"; echoData(1, $row, $rowCount); echo "&lt;/div&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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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