It would appear that you are telling the browser that you are going to be supplying a document of Content-type: text/html. Therefore, if you would like any data to appear in the browser you should print properly formated HTML.
print <<ENDOFTEXT;
Content-type: text/html\n\n
<HTML>
<HEAD> Some DB Data </HEAD>
<BODY>
......... Database results here .......