Controlling Rows
Posted: Thu Jan 05, 2006 11:37 am
Hello,
I would like to format the results pulled from my query. Right now it just lists the images since all I've included is the <br /> tag. My question is, how would I specify three images across and then start a new line?
Thanks,
-Pete
My code is as follows:
I would like to format the results pulled from my query. Right now it just lists the images since all I've included is the <br /> tag. My question is, how would I specify three images across and then start a new line?
Thanks,
-Pete
My code is as follows:
Code: Select all
<?php
include '../library/config.php';
include '../library/opendb.php';
$query = "SELECT id, name FROM upload2";
$result = mysql_query($query) or die('Error, query failed');
if(mysql_num_rows($result) == 0)
{
echo "Database is empty <br>";
}
else
{
while(list($id, $name) = mysql_fetch_array($result))
{
?>
<img src="../upload/<?=$name;?>" /> <br />
<?php
}
}
include '../library/closedb.php';
?>