Note: You are currently viewing documentation for Moodle 3.6. Up-to-date documentation for the latest stable version of Moodle is likely available here: error/moodle/invalidqueryparam.

error/moodle/invalidqueryparam

From MoodleDocs
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

One possible cause of this error is a call like

$DB->get_records_sql($sql, $params)

where the SQL query, $sql, contains several '?' which are to by substituted by $params, but fewer parameters than '?' are supplied. Check that $params was not created using unexpexted NULL values. get_records_sql() is defined in 'lib/dml/*_native_moodle_database.php', depending on which database you are using.