CI_DB_driver::query()

query($sql[, $binds = FALSE[, $return_object = NULL]])

Parameters:
  • $sql (string) – The SQL statement to execute
  • $binds (array) – An array of binding data
  • $return_object (bool) – Whether to return a result object or not
Returns:

TRUE for successful “write-type” queries, CI_DB_result instance (method chaining) on “query” success, FALSE on failure

Return type:

mixed

Execute an SQL query.

Accepts an SQL string as input and returns a result object upon successful execution of a “read” type query.

Returns:

  • Boolean TRUE upon successful execution of a “write type” queries
  • Boolean FALSE upon failure
  • CI_DB_result object for “read type” queries
doc_CodeIgniter
2016-10-15 16:31:07
Comments
Leave a Comment

Please login to continue.