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

error/moodle/invalidqueryparam: Difference between revisions

From MoodleDocs
(stub template, category)
(documented cause of my seeing the error)
Line 2: Line 2:


[[Category:Error|Invalidqueryparam]]
[[Category:Error|Invalidqueryparam]]
One possible cause of this error is a call like
<code>
$DB->get_records_sql($sql, $params)
</code>
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.

Revision as of 19:26, 1 March 2013

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.