in reply to Problem with mysql query using DBI::Mysql

When writing a CGI script, it's very important to be careful about the use of print statements. When the script is invoked by a request from a browser, everything that is output via print statements in the script will be sent back to the browser.

So, you want to make sure that you start with a valid HTTP header, then print a valid and complete html sequence (starting with <HTML> and ending with </HTML>).

The CGI module has functions for making this easier and more manageable -- and as mentioned in an earlier reply, there are also functions for creating input methods on the web page, and for handling the query parameters that come back in the request from the form.

Please look at the example code provided near the beginning of the CGI manual for guidance. Then look at how print is being (mis)used in the code you posted: your code never prints the http header (the CGI "header" function), and is printing some html content (and some non-html content) before doing print "<html>..." -- that won't work.

As suggested above, get the http/html stuff working on its own first, then add the mysql stuff.