Here is a question:
Using the instructions given it took about 30 seconds to get an additional template driven page into my forum, which was nice
Now I am fiddling around trying to get data from the database into a html table in the template and have hit a wall. Just for the sake of testing I am attempting to select all users from a specific user group and display their username in a table.
So to do this after this line:
Code:
$navbits[$parent] = 'Test Page';
I have added
Code:
$userlist = $db->query_read_slave("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE usergroupid = 2");
while ($user = $db->fetch_array($userlist))
{
//print_r($user);
}
$db->free_result($userlist);
This gets the data I want and if I uncomment the print_r function it prints the data. However I can't work out how to get the data into a table within the template.
As an example if the select return 2 users (Bob & Dave) I want to render a table that looks like this:
Code:
<table>
<tr>
<td>Username</td<
</tr>
<tr>
<td>Bob</td>
</tr>
<tr>
<td>Dave</td>
</tr>
</table>
Could somebody push me in the right direction?