From e33985ee771b157dfbf64626e45bd1ceaab8d3c1 Mon Sep 17 00:00:00 2001
From: Cerdic <cedric@yterium.com>
Date: Wed, 10 May 2006 21:33:43 +0000
Subject: [PATCH] prendre en charge le table_prefixe dans spip_mysql_showtable
 qui n'etait pas forcement fait pour ca au depart :-)

---
 ecrire/base/db_mysql.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ecrire/base/db_mysql.php b/ecrire/base/db_mysql.php
index ae478859df..d0b3cf879e 100644
--- a/ecrire/base/db_mysql.php
+++ b/ecrire/base/db_mysql.php
@@ -189,6 +189,10 @@ function spip_connect_db($host, $port, $login, $pass, $db) {
 
 function spip_mysql_showtable($nom_table)
 {
+	if ($GLOBALS['table_prefix']) $table_pref = $GLOBALS['table_prefix']."_";
+	else $table_pref = "";
+	$nom_table = preg_replace('/^spip_/', $table_pref, $nom_table);
+	
 	$a = spip_query("SHOW TABLES LIKE '$nom_table'");
 	if (!a) return "";
 	if (!spip_fetch_array($a)) return "";
-- 
GitLab