Hey Y'all
I must be getting tired because I just can't figure this out. The following script output results like this:
1image 2image 3image 4image 5image 6image
7image 8image 9mage 10image 11image 12image
I want to add another row right below the images that has the name of the image (from the same record)like this:
1image 2image 3image 4image 5image 6image
1name 2name 3name 4name 5name 6name
7image 8image 9mage 10image 11image 12image
7name 8name 9name 10name 11name 12name
any help would be greatly appreciated.
Ed
<?php
require "config.php";
if(empty($uid)) {
header("Location: ./index.php");
} else {
include "header.php";
dbcnx();
$oq_limit = $cfg['mems'];
$userz = mysql_query("SELECT * FROM $db[users] WHERE app = '0'");
$num_userz = mysql_num_rows($userz);
//Page #'s
$n_pages = ceil($num_userz / $oq_limit);
if($n_pages>1) {
$top_message = " <b>(Pages:</b> ";
for($i=1;$i<=$n_pages;$i++)
{
if($i==1) {
$top_message .= "<a href=\"./list.php\">$i</a> ";
} else {
$top_message .= "<a href=\"./list.php?page=".($oq_limit * ($i-1))."\">$i</a> ";
}
}
$pages = $top_message."<b>)</b>";
}
if(!isset($page)){
$query = mysql_query("SELECT FROM $db[users] WHERE app='0' ORDER BY screename LIMIT 0,$oq_limit");
} else {
$query = mysql_query("SELECT FROM $db[users] WHERE app='0' ORDER BY screename LIMIT $page,$oq_limit");
}
//set number of columns
$columns = 2;
$count = 0;
$num_rows = mysql_num_rows($userz);
echo "<table>";
echo "<tr>";
for($i=0; $i < $num_rows; $i++)
{
$row = mysql_fetch_array ($userz);
if($i % $columns == 0 && $i != 0)
{
echo "</tr>";
echo "<tr>";
$count = 0;
}
echo "<td>" . $row['image'] . "</td>";
$count++;
}
// This makes sure all the columns are filled
// Without this, when $num_rows % $columns does not equal 0
// There would be less columns in the last <tr> then $columns
if($columns != $count)
{
for($i = 0; $i < ($columns - $count); $i++)
{
echo"<td bgcolor=000000> </td>"; //Change this if you want to fill it with something else
}
}
echo "</tr>";
echo "</table>";
include "footer.php";
}
?>