The gallery on my site
<!-- m --><a class="postlink" href="http://afeditorials.resource-locator.com/fractal.php">http://afeditorials.resource-locator.com/fractal.php</a><!-- m -->
is generated by PHP, using a loop and calling the values from a MySQL Database.
But in a long list looks un-organised.
How do I make it have 2 images on a line, then make a new line?
(image) (image)
(image) (image)
etc
using a loop?
The PHP for the current version is below.
while ($newArray = mysql_fetch_array($result)) {
$id = $newArray['ID'];
$thumb = $newArray['ThumbURI'];
$title = $newArray['Title'];
$eight = $newArray['800URI'];
$tentwentyfour = $newArray['1024URI'];
echo "<p>$title<br /><img src=http://www.htmlforums.com/archive/index.php/\"$thumb\" alt=\"$title\" /><br /><a href=\"$eight\" title=\"800*600\" class=\"content\">800*600</a> | <a href=\"$tentwentyfour\" title=\"1024*768\" class=\"content\">1024*768</a><br /><br />";
}nevermind, I sorted it now, using floats and CSSI'm interested to see what you did, could you post some code?all you have to do set up a variable before hand as a flag
$flag = false;
while (...) {
if ($flag) {
echo $item ."<br />";
$flag = false;
} else {
echo $item;
$flag = true;
}
}
you could do this with a number also and jsut use $flag++ or something.you can do the same with tables too. which might be better than float.Originally posted by scoutt
you can do the same with tables too. which might be better than float. But n8 is anti-tables
<!-- m --><a class="postlink" href="http://afeditorials.resource-locator.com/fractal.php">http://afeditorials.resource-locator.com/fractal.php</a><!-- m -->
is generated by PHP, using a loop and calling the values from a MySQL Database.
But in a long list looks un-organised.
How do I make it have 2 images on a line, then make a new line?
(image) (image)
(image) (image)
etc
using a loop?
The PHP for the current version is below.
while ($newArray = mysql_fetch_array($result)) {
$id = $newArray['ID'];
$thumb = $newArray['ThumbURI'];
$title = $newArray['Title'];
$eight = $newArray['800URI'];
$tentwentyfour = $newArray['1024URI'];
echo "<p>$title<br /><img src=http://www.htmlforums.com/archive/index.php/\"$thumb\" alt=\"$title\" /><br /><a href=\"$eight\" title=\"800*600\" class=\"content\">800*600</a> | <a href=\"$tentwentyfour\" title=\"1024*768\" class=\"content\">1024*768</a><br /><br />";
}nevermind, I sorted it now, using floats and CSSI'm interested to see what you did, could you post some code?all you have to do set up a variable before hand as a flag
$flag = false;
while (...) {
if ($flag) {
echo $item ."<br />";
$flag = false;
} else {
echo $item;
$flag = true;
}
}
you could do this with a number also and jsut use $flag++ or something.you can do the same with tables too. which might be better than float.Originally posted by scoutt
you can do the same with tables too. which might be better than float. But n8 is anti-tables