thx Natty_Dreadlock for the reply and info, i was unable to acheive desired w/ this new info.
basically what i'm trying to do is;
load array with three rows of db (1 column) info, then echo that into a table, 2 rows, 3, cols. repeat w/ next three rows from db, and so on. end result will be a table with a series of 2 row/3 cols pieces.
i've simplified the code for testing purposes;
$result = mysql_query($sql) or die (mysql_error());
while ($row = mysql_fetch_array($result)) {
$threeN = array();
$threePID = array();
$threeN[] = $row['portfolioCompanyName'];
$threePID[] = $row['portfolioID'];
if(sizeof($threePID) > 3)
$threePID = array();
if(sizeof($threeN) > 3)
$threeN = array();
echo ("
<tr>
<td align='center' class='dName'><a href='link.php?{$threePID[0]}'>$threeN[0]</a> </td>
<td align='center' class='dName'><a href='link.php?{$threePID[1]}'>$threeN[1]</a> </td>
<td align='center' class='dName'><a href='link.php?{$threePID[2]}'>$threeN[2]</a> </td>
</tr>
<tr>
<td align='center' class='dName'><a href='link.php?{$threePID[0]}'>$threePID[0]</a> </td>
<td align='center' class='dName'><a href='link.php?{$threePID[1]}'>$threePID[1]</a> </td>
<td align='center' class='dName'><a href='link.php?{$threePID[2]}'>$threePID[2]</a> </td>
</tr>
");
this code results in a table with only 1 item in the first cell of each row. it's the correct data, but trying to get to echo as 3 col rows.
the above code results in this;
$result = mysql_query($sql) or die (mysql_error());
while ($row = mysql_fetch_array($result)) {
$threeN = array();
$threePID = array();
$threeN[] = $row['portfolioCompanyName'];
$threePID[] = $row['portfolioID'];
if(sizeof($threePID) > 3)
$threePID = array();
if(sizeof($threeN) > 3)
$threeN = array();
echo ("
<tr>
<td align='center' class='dName'><a href='link.php?{$threePID[0]}'>$threeN[0]</a> </td>
</tr>
<tr>
<td align='center' class='dName'><a href='link.php?{$threePID[0]}'>$threePID[0]</a> </td>
</tr>
");
}
?
i'm not familiar w/ arrays too much, not sure how to get a diff. value into the array 3 times, then loop w/ the next three values.
any ideas?
thank you.