In addition to the other suggestions here, you might wrap your DBI calls in an eval {} block, check for errors and then print out a helpful message to the browser if a message is found. Also, you should print out your http header before you do anything else to make this possible.
# I assume that this routine prints out the http header &header("We are done"); $query = "SELECT nw_ucountry FROM $Table"; $query .= " WHERE nw_ucountry LIKE '$country'"; my ($sth); eval { $sth = $dbh->prepare($query); $sth->execute; }; if ( $@ ) { print "<p>Error found executing SQL.\n", "<pre>$query\nError: $@</pre>"; } else { while (($qcountry) = $sth->fetchrow_array()) { ... } }
It also helps greatly if you can keep an eye on your web server's error logs. Messages output from a die (either explicitly or implicitly using the RaiseError attribute) should appear there and would be much more helpful than the message that appears to the browser.
Chris
M-x auto-bs-mode
In reply to RE: MySQL and PERL tribulations....
by lachoy
in thread MySQL and PERL tribulations....
by bman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |