si vous regardez système 2.x CodeIgniter/base de données/pilotes/DB_driver.php près de la ligne 902
ou
à CodeIgniters système 3.x/base de données/db_driver près de la ligne 1365
vous trouverez une fonction appelée insert_string() qui ressemble à ceci:
/**
* Generate an insert string
*
* @access public
* @param string the table upon which the query will be performed
* @param array an associative array data of key/values
* @return string
*/
function insert_string($table, $data)
{
$fields = array();
$values = array();
foreach ($data as $key => $val)
{
$fields[] = $this->_escape_identifiers($key);
$values[] = $this->escape($val);
}
return $this->_insert($this->_protect_identifiers($table, TRUE, NULL, FALSE), $fields, $values);
}
puis le suivi _protect_identifiers de fonction() près de la ligne 1246 (CI 2.x) ou ligne près de 1729 (3.0 CI), qui dit:
* Since the column name can include up to four segments (host, DB, table, column)
* or also have an alias prefix, we need to do a bit of work to figure this out and
* insert the table prefix (if it exists) in the proper position, and escape only
* the correct identifiers.
donc la réponse est OUI.
en cas de doute, vous pouvez toujours utiliser: echo ($this->db->last_query());die();
qui imprime votre dernière requête effectuée ce qui pourrait ressembler à ceci:
INSERT INTO `googlemaps_marker` (`descr`, `Lat`, `Lng`, `pretty_url`, `ID`, `zone_ID`, `kind`, `author_id`, `author`, `date_updated`) VALUES ('sasasasdas', '41.27780646738183', '-7.437744140625', 'sasasasdas', 4, 4, 1, '1', 'Admini Istrator', '2017-07-15 18:20:40')
En effet, vous avez raison. juste confirmé. Merci! – Alex