The code for getalert in C4::Letters fails to account for one important case. While the POD says "all parameters NON mandatory", the result of NO arguments produces invalid SQL. The errors in the log look like: [error] [client 71.64.0.171] [Mon Jul 11 19:54:12 2011] opac-user.pl: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at /usr/share/koha/lib/C4/Letters.pm line 197, <DATA> line 522., referer: https://my.koha.edu/cgi-bin/koha/opac-user.pl [error] [client 71.64.0.171] [Mon Jul 11 19:54:12 2011] opac-user.pl: DBD::mysql::st fetchall_arrayref failed: fetch() without execute() at /usr/share/koha/lib/C4/Letters.pm line 198, <DATA> line 522., referer: https://my.koha.edu/cgi-bin/koha/opac-user.pl If you look at the logic, you'll agree that "SELECT * FROM alert WHERE" is not a valid SQL query. Code should assemble bind name/value pairs in a hash instead of appending to the query and pushing onto an array. Then build the WHERE clause at the end only when hash is populated.
Alternatively, the standard hack of "SELECT ... WHERE 1 AND ..." could be used here.
You are not allowed to use Koha with the DB user.