X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sql%2Falter2.2.php;h=c5345233f9dad968a351735b71f50b2df0a31924;hb=bb991dc5b071e966b39954bb53d3b0efe8420938;hp=e94187d38e8a7ef2b8ef223950f0ac6ac8bad6c2;hpb=2a42ffb56ef6651b8a136cd89271e65d397d7677;p=fa-stable.git diff --git a/sql/alter2.2.php b/sql/alter2.2.php index e94187d3..c5345233 100644 --- a/sql/alter2.2.php +++ b/sql/alter2.2.php @@ -287,7 +287,7 @@ function sanitize_database($pref, $test = false) { if ($test) error_log('Sanitizing database ...'); - $tsql = "SHOW TABLES LIKE '{$pref}%'"; + $tsql = "SHOW TABLES LIKE '".($pref=='' ? '' : substr($pref,0,-1).'\\_')."%'"; $tresult = db_query($tsql, "Cannot select all tables with prefix '$pref'"); while($tbl = db_fetch($tresult)) { $table = $tbl[0];