i'm failing at trying to get data out of mysql and formated in html they way i want.
aiming for a 3 column table with a row for thumbs followed by a row for name of thumb, repeat per records in db.
getting somewhere close, but no cigar on the following code;
$sql = ("
SELECT ID,
Category,
Name,
Desc01,
Desc02,
Desc03,
ThumbLink,
ImageLink
FROM foo
");
$result = mysql_query($sql) or die (mysql_error());
while ($row = mysql_fetch_array($result)) {
$ID = $row['ID'];
$Category = $row['Category'];
$Name = $row['Name'];
$Desc01 = $row['Desc01'];
$Desc02 = $row['Desc02'];
$Desc03 = $row['Desc03'];
$ThumbLink = $row['Thumb'];
$ImageLink = $row['Image'];
// create array from table for thumb, name and id
$threeI[] = $row['Thumb'];
$threeN[] = $row['Name'];
$threePID[] = $row['ID'];
// this isn't working...?
echo ("
<tr>
<td align='center'><a href='link.php?$threePID[0]'><img src='/images/$threeI[0]' border='0'></a></td>
<td align='center'><a href='link.php?$threePID[1]'><img src='/images/$threeI[1]' border='0'></a></td>
<td align='center'><a href='link.php?$threePID[2]'><img src='/images/$threeI[2]' border='0'></a></td>
</tr>
<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>
");
}
my problem is the loop isn't working, or the arrays aren't working - somehow got to get it to loop so that each time the three thumbs/name/ids are the next three from the db...
any assistance would be greatly appreciated.
thank you.