array
0 =>
array
'id' => float 1110
'description' => string 'Culture de céréales (à l'exception du riz), de légumineuses et de graines oléagineuses' (length=86)
'field2' => float 11
'field3' => float 26.631
1 =>
array
'id' => float 1120
'description' => string 'Culture du riz' (length=14)
'field2' => float 11
'field3' => float 7.556
With this array what is the correct process for the string "description" to avoid SQL error when data is added with db_insert
?
I use this code for multiple insert :
$query = db_insert('table')->fields(array('id', 'description', 'field2', 'field3'));
foreach ($sql_query as $record) {
$query->values($record);
}
$query->execute();
// $sql_query is the array described above.