Subversion Repositories eFlore/Applications.cel

Rev

Rev 3555 | Rev 3557 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3555 Rev 3556
Line 813... Line 813...
813
	}
813
	}
Line 814... Line 814...
814
 
814
 
815
	private function construireRequeteInsertionImage($informations) {
815
	private function construireRequeteInsertionImage($informations) {
816
		$champs = array();
816
		$champs = array();
-
 
817
		$valeurs = array();
817
		$valeurs = array();
818
		$url = $informations['url'];
818
		foreach ($informations as $champ => $valeur) {
819
		foreach ($informations as $champ => $valeur) {
819
			$champs[] = $champ;
820
			$champs[] = $champ;
820
			if (is_null($valeur)) {
821
			if (is_null($valeur)) {
821
				$valeurs[] = 'NULL';
822
				$valeurs[$champ] = 'NULL';
822
			} else if ($valeur === 'NOW()') {
823
			} else if ($valeur === 'NOW()') {
823
				$valeurs[] = $valeur;
824
				$valeurs[$champ] = $valeur;
824
			} else {
825
			} else {
825
				$valeurs[] = Cel::db()->proteger($valeur);
826
				$valeurs[$champ] = Cel::db()->proteger($valeur);
826
			}
827
			}
827
		}
828
		}
-
 
829
		$champsConcat = implode(', ', $champs);
828
		$champsConcat = implode(', ', $champs);
830
		$valeurs['url'] = $url;
Line 829... Line 831...
829
		$valeursConcat = implode(', ', $valeurs);
831
		$valeursConcat = implode(', ', $valeurs);
830
 
832
 
831
		$requete = "INSERT INTO photo ($champsConcat) VALUES ($valeursConcat) ".
833
		$requete = "INSERT INTO photo ($champsConcat) VALUES ($valeursConcat) ".