MantisBT: master fbf016c3

Author Committer Branch Timestamp Parent
dregad dregad master 2014-07-07 14:50 master 83e1cfde
Changeset

Fix db_query_bound() to work with ADOdb::Execute()

In ADOdb v5.19 the Execute() method was modified to perform a strict
type check on the $inputarr parameter. Since that param defaults to
'false', database errors are triggered when the method receives 'null'
and there are no parameters to the query being executed.

Since db_query_bound() $p_arr_parms defaults to null, the problem occurs
almost everywhere. To fix this, we can either:

  1. set $p_arr_parms to array() when it is null
  2. defaut $p_arr_parms to array()

The 2nd option would cause errors with db_query_bound($sql, null)
calls, so we implement the first one as it offers better backwards
compatibility.

Function can be called like this (the first 3 methods being equivalent):

  • db_query_bound($sql)
  • db_query_bound($sql, null)
  • db_query_bound($sql, array())
  • db_query_bound($sql, array(1,2))
mod - core/database_api.php Diff File