Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dbname=’db’; //your database name
- $username=’userrname’; // your database user name
- $password=’password’; //your database user password
- $db = mysql_connect($dbname,$username,$password);
- if (!$db) {
- echo "Cannot connect to the database – incorrect details";
- } else {
- mysql_select_db(‘pm’);
- $result = mysql_query(‘show tables’);
- while ($tables = mysql_fetch_array($result)) {
- foreach ($tables as $key => $value) {
- mysql_query("ALTER TABLE $value COLLATE utf8_general_ci");
- }
- }
- echo "The collation of your database has been successfully changed!";
- }
Add Comment
Please, Sign In to add comment