in reply to help deriving mysql query from perl script
The easiest way to find out what SQL queries your script sends to the database to look at the MySQL query log.
The other easy way is to turn on SQL tracing on your database handle in DBI.
Before turning to such heavy handed approaches, especially when you're not even sure whether the script works or not, I would rip out the "web" part of the program.
Luckily, your program is basically structured as two parts, the part above
$where_clause = "rwsurvey.type = 'LIT' and ".$where_clause;
... which mostly deals with generating the web form, and the part below, which deals with talking to the database and output. So you can just take the lower part, fix up $where_clause with the appropriate value, and you've eliminated the web server as source of errors and can inspect the error messages on the console.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: help deriving mysql query from perl script
by alison-g (Novice) on Jul 30, 2012 at 08:05 UTC | |
by Corion (Patriarch) on Jul 30, 2012 at 08:48 UTC |