Okay, i need to create a 6x3 table.. 6 rows, 3 columns. I have a script so far, but it... doesnt exactly format the pictures in the right places o_x. The first row all goes as planned, the 2nd row works for the text, then the 3rd row doesnt display pictures as it should, 4th row shows text, 5th row no pictures, 6th row text. The pictures however, DO output, and are below the 6th row in seperate rows of thier own.
here's what i have so far...
<?php
$numlow2 = $numlow;
$numhigh2 = $numlow2 + 8;
$numhigh = $numlow + 8;
$row = 1;
$rowsneeded = 6;
$cell = 0;
$cellsneeded = 3;
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle))) {
if ( $row = 1 || 3 || 5 ) {
echo ("<tr>");
for ( ; $numlow <= $numhigh; $numlow++ )
{
$cell++;
echo ("<td>");
print ("<img src='");
echo ($numlow);
print (".jpg' width=210px height=155px>");
echo ("</td>");
if ( $cell == 3 ) {
echo ("</tr>");
$cell = 0;
$row++;
}
}
if ( $row == 2 || 4 || 6 ) {
echo ("<tr>");
for ( ; $numlow2 <= $numhigh2; $numlow2++ ) {
$cell++;
$result = $db->query("SELECT * FROM `prop_data` WHERE `key`='$numlow2' ORDER BY `key` DESC");
$prop = $db->arr($result);
echo ("<td class='write'><h5>");
print ("<b class='black'>");
echo ($prop['name']);
print ("</b> ");
echo ($prop['desc']);
print ("<br>$");
echo ($prop['price']);
print (", Key Number: ");
echo ($prop['key']);
echo ("</td>");
if ( $cell == 3 ) {
echo ("</tr>");
$cell = 0;
$row++;
}
}
}
}
}
}
closedir($handle);
?>