Home>Article>Backend Development> How to set table prefix in php
How to set the table prefix in php: first enter the database user name and password; then connect to the database; then modify the table prefix through the "str_replace($seach,$replace,$name['0']);" statement. Can.
Recommended: "PHP Video Tutorial"
php batch change database table prefix
We often encounter the problem of replacing or adding database table prefixes. Exporting the database, making batch changes on Notepad, and then exporting is also a method, but it is not convenient enough.
It can be easily done through the following method. The code is as follows, if you find it useful, please give me some advice.
If you add a prefix, you only need to change it a little
$table = str_replace($seach,$replace,$name['0']);换成 $table = $replace.$name['0'];
.
The above is the detailed content of How to set table prefix in php. For more information, please follow other related articles on the PHP Chinese website!