Bonjour,
Ma configuration WP actuelle
– Version de WordPress :
– Version de PHP/MySQL :
– Thème utilisé :
– Extensions en place :
– Nom de l’hebergeur :
– Adresse du site :
Problème(s) rencontré(s) :
Le codex dit ceci en anglais :
insert( $table, $data, $format ); ?>
table
(string) The name of the table to insert data into.
data
(array) Data to insert (in column => value pairs). Both $data columns and $data values should be « raw » (neither should be SQL escaped).
Quelle est la traduction exacte de « escaped » ?
Je comprends sans les quotes ‘, mais l’exemple du codex plus bas est avec quote.
format
(array|string) (optional) An array of formats to be mapped to each of the value in $data. If string, that format will be used for all of the values in $data. If omitted, all values in $data will be treated as strings unless otherwise specified in wpdb::$field_types.
Possible format values: %s as string; %d as decimal number; and %f as float.
…
Examples
Insert two columns in a row, the first value being a string and the second a number:
$wpdb->insert(
‘table’,
array(
‘column1’ => ‘value1’,
‘column2’ => 123
),
array(
‘%s’,
‘%d’
)
);
Alors, la question est celle-ci faut-il mettre le nom des colonnes entre quote ou sans quote ?
cela a-t-il une importance ?
J’ai fait l’essai et avec ou sans quote sur le nom des colonnes cela ne change rien…
Que veut dire exactement « escaped » and « unescaped » ?