Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3555 → Rev 3556

/trunk/jrest/services/CelWidgetSaisie.php
815,17 → 815,19
private function construireRequeteInsertionImage($informations) {
$champs = array();
$valeurs = array();
$url = $informations['url'];
foreach ($informations as $champ => $valeur) {
$champs[] = $champ;
if (is_null($valeur)) {
$valeurs[] = 'NULL';
$valeurs[$champ] = 'NULL';
} else if ($valeur === 'NOW()') {
$valeurs[] = $valeur;
$valeurs[$champ] = $valeur;
} else {
$valeurs[] = Cel::db()->proteger($valeur);
$valeurs[$champ] = Cel::db()->proteger($valeur);
}
}
$champsConcat = implode(', ', $champs);
$valeurs['url'] = $url;
$valeursConcat = implode(', ', $valeurs);
 
$requete = "INSERT INTO photo ($champsConcat) VALUES ($valeursConcat) ".