when you use the setDbLoop function you must pass through the result resource, i.e.:
...
$result = mysql_querySELECT id,username,email FROM users;
$tmpl-setDbLooploop1, $result, MYSQL;
...
If you think that you're doing it correctly then put "get_resource_type($result)" after the mysql call to see what result resource it is. It should be "mysql result".
It may be that there's an error with your SQL.
Try:
$result = mysql_querySELECT id,username,email FROM users;
or diemysql_error;
to see if there's a problem there.
If it still isn't working then post the part of the code that isn't working to the forum and I'll take a look.
Regards,
Kelvin