Subversion Repositories eFlore/Applications.cel

Rev

Rev 3084 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3084 Rev 3096
Line 149... Line 149...
149
		$idElementLieP = Cel::db()->proteger($id_element_lie);
149
		$idElementLieP = Cel::db()->proteger($id_element_lie);
150
		$idMotCleP = Cel::db()->proteger($id_mot_cle);
150
		$idMotCleP = Cel::db()->proteger($id_mot_cle);
Line 151... Line 151...
151
 
151
 
152
		$requete = "INSERT INTO {$this->table_liaison} (id_element_lie, id_mot_cle) ".
152
		$requete = "INSERT INTO {$this->table_liaison} (id_element_lie, id_mot_cle) ".
153
			"VALUES ($idElementLieP, $idMotCleP) ".
153
			"VALUES ($idElementLieP, $idMotCleP) ".
154
			'ON DUPLICATE KEY UPDATE id_element_lie = id_element_lie '.
154
			'ON DUPLICATE KEY UPDATE `id_element_lie`=VALUES(`id_element_lie`), `id_mot_cle`=VALUES(`id_mot_cle`) '.
155
			' -- '.__FILE__.':'.__LINE__;
155
			' -- '.__FILE__.':'.__LINE__;
156
		return Cel::db()->executer($requete);
156
		return Cel::db()->executer($requete);
Line 157... Line 157...
157
	}
157
	}
Line 166... Line 166...
166
			"WHERE chemin = $cheminP ".
166
			"WHERE chemin = $cheminP ".
167
			"AND id_utilisateur = $idUtilisateurP ".
167
			"AND id_utilisateur = $idUtilisateurP ".
168
			')';
168
			')';
169
		$requete = "INSERT INTO {$this->table_liaison} (id_element_lie, id_mot_cle) ".
169
		$requete = "INSERT INTO {$this->table_liaison} (id_element_lie, id_mot_cle) ".
170
			"VALUES ($idElementLieP, $sousRequete) ".
170
			"VALUES ($idElementLieP, $sousRequete) ".
171
			'ON DUPLICATE KEY UPDATE id_element_lie = id_element_lie '.
171
			'ON DUPLICATE KEY UPDATE `id_element_lie`=VALUES(`id_element_lie`), `id_mot_cle`=VALUES(`id_mot_cle`) '.
172
			' -- '.__FILE__.':'.__LINE__;
172
			' -- '.__FILE__.':'.__LINE__;
173
		return Cel::db()->executer($requete);
173
		return Cel::db()->executer($requete);
174
	}
174
	}
Line 175... Line 175...
175
 
175
 
Line 184... Line 184...
184
		}
184
		}
Line 185... Line 185...
185
 
185
 
186
		$valeursGroupees = implode(', ', $combinaisons);
186
		$valeursGroupees = implode(', ', $combinaisons);
187
		$requete = "INSERT INTO {$this->table_liaison} (id_element_lie, id_mot_cle) ".
187
		$requete = "INSERT INTO {$this->table_liaison} (id_element_lie, id_mot_cle) ".
188
			"VALUES $valeursGroupees ".
188
			"VALUES $valeursGroupees ".
189
			"ON DUPLICATE KEY UPDATE id_element_lie = id_element_lie ".
189
			"ON DUPLICATE KEY UPDATE `id_element_lie`=VALUES(`id_element_lie`), `id_mot_cle`=VALUES(`id_mot_cle`) ".
190
			' -- '.__FILE__.':'.__LINE__;
190
			' -- '.__FILE__.':'.__LINE__;
191
		return Cel::db()->executer($requete);
191
		return Cel::db()->executer($requete);
Line 192... Line 192...
192
	}
192
	}
Line 228... Line 228...
228
					$combinaisons[] = "($idElementLieP, $idMotCleP)";
228
					$combinaisons[] = "($idElementLieP, $idMotCleP)";
229
				}
229
				}
230
				$valeursGroupees = implode(', ', $combinaisons);
230
				$valeursGroupees = implode(', ', $combinaisons);
231
				$requete = "INSERT INTO {$this->table_liaison} (id_element_lie, id_mot_cle) ".
231
				$requete = "INSERT INTO {$this->table_liaison} (id_element_lie, id_mot_cle) ".
232
						"VALUES $valeursGroupees ".
232
						"VALUES $valeursGroupees ".
233
						"ON DUPLICATE KEY UPDATE id_element_lie = id_element_lie ". // normalement pas nécessaire
233
						"ON DUPLICATE KEY UPDATE `id_element_lie`=VALUES(`id_element_lie`), `id_mot_cle`=VALUES(`id_mot_cle`) ". // normalement pas nécessaire
234
						' -- '.__FILE__.':'.__LINE__;
234
						' -- '.__FILE__.':'.__LINE__;
235
				$resultat = Cel::db()->executer($requete);
235
				$resultat = Cel::db()->executer($requete);
236
				$reussi = ($reussi && $resultat);
236
				$reussi = ($reussi && $resultat);
237
			}
237
			}