From f8a3d9298810b4d3a3db6eac43b5f972b20b3dfa Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 13 Mar 2003 19:36:26 +0000 Subject: [PATCH] Nouveau fichier --- htdocs/admin/sql.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 htdocs/admin/sql.php diff --git a/htdocs/admin/sql.php b/htdocs/admin/sql.php new file mode 100644 index 00000000000..a11e995c80e --- /dev/null +++ b/htdocs/admin/sql.php @@ -0,0 +1,43 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + */ + +Function db_create_table($db, $table) +{ + + $sql = ""; + $fcontents = file( "../../mysql/tables/$table.sql" ); + + while ( list( $numero_ligne, $ligne ) = each( $fcontents ) ) + { + $sql .= $ligne; + } + + return $db->query($sql); +} + +Function db_drop_table($db, $table) +{ + + return $db->query("DROP table $table"); +} + + +?>