Guest User

Untitled

a guest
Feb 4th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. $dbname=’db’; //your database name
  2. $username=’userrname’; // your database user name
  3. $password=’password’; //your database user password
  4. $db = mysql_connect($dbname,$username,$password);
  5.  
  6. if (!$db) {
  7. echo "Cannot connect to the database – incorrect details";
  8. } else {
  9. mysql_select_db(‘pm’);
  10. $result = mysql_query(‘show tables’);
  11. while ($tables = mysql_fetch_array($result)) {
  12. foreach ($tables as $key => $value) {
  13. mysql_query("ALTER TABLE $value COLLATE utf8_general_ci");
  14. }
  15. }
  16. echo "The collation of your database has been successfully changed!";
  17. }
Add Comment
Please, Sign In to add comment