Using the following method, it can be easily done. The code is as follows, if you find it useful, please give me some advice.
Copy code The code is as follows:
$user = "root"; //Database user name
$pwd = "pwd"; //Database password
$replace ='pre_'; // Replaced prefix
= 'pre1_'; . Connect to database
$tables = mysql_list_tables("$database");
while($name = mysql_fetch_array($tables)) {
$table = str_replace($seach,$replace,$name['0']); 🎜>
?>
If you want to add a prefix, you only need to change it a little bit
Copy the code
The code is as follows:
$table = str_replace($seach,$replace,$name['0']); Replace with $table = $replace.$name['0'];
That’s it.
http://www.bkjia.com/PHPjc/824860.htmlwww.bkjia.com
truehttp: //www.bkjia.com/PHPjc/824860.htmlTechArticleUsing the following method, you can easily do it. The code is as follows, if you find it useful, please give it a thumbs up. Copy the code The code is as follows: ?php $database = "databaseName"; //Database name $user = "root"; //Database...