From 4c1a921f35c191f873592209837494ee4c5b924a Mon Sep 17 00:00:00 2001
From: "Committo,Ergo:sum" <esj@rezo.net>
Date: Wed, 31 Aug 2005 22:30:34 +0000
Subject: [PATCH] compatibilite Postgres (INSERT)

---
 ecrire/inc_base.php3  | 6 +++---
 ecrire/inc_index.php3 | 6 +++---
 ecrire/install.php3   | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/ecrire/inc_base.php3 b/ecrire/inc_base.php3
index 158b498f02..b616250a66 100644
--- a/ecrire/inc_base.php3
+++ b/ecrire/inc_base.php3
@@ -69,17 +69,17 @@ function creer_base() {
 		spip_create_table($k, $v['field'], $v['key'], false);
 
 	foreach($tables_images as $k => $v)
-		spip_query_db("INSERT IGNORE spip_types_documents (extension, inclus, titre, id_type) VALUES ('$k', 'image', '" .
+		spip_query_db("INSERT IGNORE INTO spip_types_documents (extension, inclus, titre, id_type) VALUES ('$k', 'image', '" .
 			      (is_numeric($v) ?
 			       (strtoupper($k) . "', $v") :
 			       "$v', 0") .
 			      ")");
 
 	foreach($tables_sequences as $k => $v)
-		spip_query_db("INSERT IGNORE spip_types_documents (extension, titre, inclus) VALUES ('$k', '$v', 'embed')");
+		spip_query_db("INSERT IGNORE INTO spip_types_documents (extension, titre, inclus) VALUES ('$k', '$v', 'embed')");
 
 	foreach($tables_documents as $k => $v)
-		spip_query_db("INSERT IGNORE spip_types_documents (extension, titre, inclus) VALUES ('$k', '$v', 'non')");
+		spip_query_db("INSERT IGNORE INTO spip_types_documents (extension, titre, inclus) VALUES ('$k', '$v', 'non')");
 
 	foreach ($tables_mime as $extension => $type_mime)
 	  spip_query_db("UPDATE spip_types_documents
diff --git a/ecrire/inc_index.php3 b/ecrire/inc_index.php3
index 23cb6ce0d6..db027a4994 100644
--- a/ecrire/inc_index.php3
+++ b/ecrire/inc_index.php3
@@ -390,9 +390,9 @@ function indexer_objet($type, $id_objet, $forcer_reset = true) {
 			spip_query($mots);
 		}
 		reset($index);
-		unset($q);
-		while (list($hash, $points) = each($index)) $q[] = "(0x$hash,".ceil($points).",$id_objet)";
-		spip_query("INSERT INTO $table_index (hash, points, $col_id) VALUES ".join(',',$q));
+		while (list($hash, $points) = each($index)) {
+		  spip_query("INSERT INTO $table_index (hash, points, $col_id) VALUES (0x$hash,".ceil($points).",$id_objet)");
+		}
 	}
 
 	// marquer "indexe"
diff --git a/ecrire/install.php3 b/ecrire/install.php3
index 18ba70fda2..0a4a339b88 100644
--- a/ecrire/install.php3
+++ b/ecrire/install.php3
@@ -273,7 +273,7 @@ else if ($etape == 4) {
 	// Tester $mysql_rappel_nom_base
 	$GLOBALS['mysql_rappel_nom_base'] = true;
 	$GLOBALS['spip_mysql_db'] = $sel_db;
-	$ok_rappel_nom = spip_query("INSERT spip_meta (nom,valeur)
+	$ok_rappel_nom = spip_query("INSERT INTO spip_meta (nom,valeur)
 		VALUES ('mysql_rappel_nom_base', 'test')");
 	if ($ok_rappel_nom) {
 		echo " (ok rappel nom base `$sel_db`.spip_meta) ";
@@ -287,7 +287,7 @@ else if ($etape == 4) {
 	}
 
 	if ($nouvelle) {
-		spip_query("INSERT spip_meta (nom, valeur) VALUES ('nouvelle_install', 'oui')");
+		spip_query("INSERT INTO spip_meta (nom, valeur) VALUES ('nouvelle_install', 'oui')");
 		$result_ok = !spip_sql_errno();
 	} else {
 		$result = spip_query("SELECT COUNT(*) FROM spip_articles");
-- 
GitLab