hi,
Allen was nice enough to provide some code that I put into this function
function display_color_details($color)
{
// display all details about this book
if (is_array($color))
{
echo "<table><tr>";
echo "<td>";
$tick = 0;
while(list(,$v) = @each($color[pic_thumbnail])) {
echo "<td>";
echo "<img src=\"$v\" width=100 height=100>";
echo "</td>";
if (!++$tick % 6) { // six table cells
echo "</tr><tr>";
}
}
echo "</table>";
}
else
echo "The details of this book cannot be displayed at this time.";
echo "<hr>";
}
I modified this line
while(list(,$v) = @each($color[pic_thumbnail])) {
This is supposed to take an array $color of images and return them in a table with only six colums, at which time it creates a new row.
My problem is
1. it returns more than 6 colums and never creates a new <tr>
- Can list() handle an aray with multiple elements? $color returns elements colr_name, color_num, pic_thumbnail and pic_large?
Thanks,
John