Error Reading from Database

Error Reading from Database

by Louise Bennett -
Number of replies: 5

Hi everyone,

I've recently installed this module on my 2.0.1 installation (Windows, mySQL), and everything seemed to be working fine. I created a questionnaire, added questions, all good.

But now, when I use MyMoodle, I get the following error message:

Debug info: 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 ') OR (l.course = 5 AND l.time > ) OR (l.course = 6 AND l.time > ) OR (l.course =' at line 1
SELECT instance,cmid,l.course,COUNT(l.id) as count FROM log l JOIN course_modules cm ON cm.id = cmid JOIN questionnaire q ON cm.instance = q.id WHERE ((l.course = 7 AND l.time > ) OR (l.course = 5 AND l.time > ) OR (l.course = 6 AND l.time > ) OR (l.course = 3 AND l.time > ) OR (l.course = 2 AND l.time > ) OR (l.course = 8 AND l.time > ) OR (l.course = 9 AND l.time > ) ) AND l.module = 'questionnaire' AND action = 'submit' AND userid != 19 AND q.resp_view <> 1 GROUP BY cmid,l.course,instance
[array (
)]
Stack trace:
  • line 391 of \lib\dml\moodle_database.php: dml_read_exception thrown
  • line 775 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 811 of \mod\questionnaire\lib.php: call to mysqli_native_moodle_database->get_records_sql()
  • line 856 of \course\lib.php: call to questionnaire_print_overview()
  • line 107 of \blocks\course_overview\block_course_overview.php: call to print_overview()
  • line 279 of \blocks\moodleblock.class.php: call to block_course_overview->get_content()
  • line 232 of \blocks\moodleblock.class.php: call to block_base->formatted_contents()
  • line 895 of \lib\blocklib.php: call to block_base->get_content_for_output()
  • line 947 of \lib\blocklib.php: call to block_manager->create_block_contents()
  • line 304 of \lib\blocklib.php: call to block_manager->ensure_content_created()
  • line 919 of \lib\outputrenderers.php: call to block_manager->get_content_for_region()
  • line 148 of \my\index.php: call to core_renderer->blocks_for_region()

 

Any ideas?

Average of ratings: -
In reply to Louise Bennett

Re: Error Reading from Database

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks for reporting. I've created bug report CONTRIB-2942 and hope my co-maintainer Mike Churchward will find a fix for this.

Joseph

In reply to Louise Bennett

Re: Error Reading from Database

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

I committed a change today that updated the database calls used in that function to the latest API's. But, I could never duplicate the error you were having. Can you check again with the latest code in HEAD?

mike

In reply to Mike Churchward

Re: Error Reading from Database

by Louise Bennett -

Hi Mike,

We've since updated to a more recent version of Moodle, and that seems to have fixed the problem (however it was happening). However: I just tried to download and install your latest 2.0 version, and the download link doesn't work (file not found).

Thanks!