MyBB Community Forums

Full Version: trying to get generated results to show
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am working on a script but i can't get it to work right.
this is the code i am working on
while($result = $db->fetch_array($query))

{
    $data1 = $result['clan'];
    $sql=$db->query("SELECT * FROM `fusion87g41_clan` WHERE clan='$data1'");
    
    

    while($clan=$db->fetch_array($sql))
    {
    $name=$clan['name'];
    $clans=$clan['clan'];
    
    $clanmates= "<tr>
                <td class='trow1'> $name</td>
                <td class='trow1'> $clans</td>
        </tr>";
            
    }
}



it shows on record but i am trying to get it to show more then one record.

btw i am using template for the custom page.

how do i get it to show more then one result on the template page

template page:

<html>

<head>
<title>Your title here</title>
{$headerinclude}
</head>
<body>
{$header}
<table border='0' cellspacing='1' cellpadding='4' class='tborder'>
       {$title}
        <tr>
                <td class='tcat'><span class='smalltext'><strong>Member</strong></span></td>
                <td class='tcat'><span class='smalltext'><strong>Clan</strong></span></td>
        </tr>
        {$clanmates}
</table>
{$footer}
</body>
</html>

change

$clanmates= "<tr>
                <td class='trow1'> $name</td>
                <td class='trow1'> $clans</td>
        </tr>";

to

$clanmates .= "<tr>
                <td class='trow1'> $name</td>
                <td class='trow1'> $clans</td>
        </tr>";
thanks never thought of that.