Here is my current code. I\'m trying to display data from three separate queries into a single table with multiple columns. Is my while statement wrong here? It\'s printing 1 ta
$data = array();
while($row = mysql_fetch_assoc($july)) {$data['row'][] = $row;}
while($row = mysql_fetch_assoc($aug)) {$data['row2'][] = $row;}
while($row = mysql_fetch_assoc($sept)) {$data['row3'][] = $row;}
$count = count($data['row']);
for($i=0;$i<=$count;$i++)
{
echo '';
if(($i % 3) == 1)
{
echo "" . $data['row3'][$i]['cUsername'] . " ";
echo "" . $data['row3'][$i]['postCount'] . " ";
}else if(($i % 2) == 1)
{
echo "" . $data['row2'][$i]['cUsername'] . " ";
echo "" . $data['row2'][$i]['postCount'] . " ";
}else /*Never try find remainder of 1 as theres always a multiple of 1*/
{
echo "" . $data['row'][$i]['cUsername'] . " ";
echo "" . $data['row'][$i]['postCount'] . " ";
}
echo ' ';
}
By fetching the results individually into a local array instead of trying to fetch 3 different rows at the same time you should do them individually and store them in a local variable, just unset the variable after words if its a large array.
my code is offered as untested.