Where are you doing the profiler INIT? Is the database set to the right database at that point?
<profiler INIT proftbl test Query>
This statement is written just before inserting data in "html" table.
Yes, right database is set at this point.