MOD MySQL est remplacé par PostgreSQL (fini)
[cl7.git] / php / update_db.php
index 66a3216..be2c041 100644 (file)
@@ -36,7 +36,7 @@ function creer_db()
    ");
    pg_query("
       CREATE TABLE participants (
-        id serial NOT NULL,
+        id int NOT NULL,
         pseudo varchar(50) DEFAULT NULL,
         clan_nom varchar(30) DEFAULT NULL,
         clan_tag varchar(10) DEFAULT NULL,
@@ -105,12 +105,12 @@ function update_db()
    # si la table 'config' n'existe pas alors on suppose qu'aucune table n'existe
    $version = 0;
    $res = @pg_fetch_object(pg_query("SELECT valeur FROM config WHERE nom = 'version'"));
-   if (pg_result_status($res) != PGSQL_COMMAND_OK)
+   if (pg_result_status($res) != PGSQL_TUPLES_OK)
       $version = $res->valeur;
       
    if($version == 0)
    {
-      echo "Création de la base de donnée, version = 1";
+      echo "Création de la base de donnée, version = 1\n";
       pg_query("BEGIN");
       creer_db();
       initialiser_db();