uhh.. the database stuff goes at the beginning of the page. and the PHP script I included earlier replaces the comment that reads, "//table code here."