Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.42 KB | None | 0 0
  1. <?php
  2. $db = mysql_connect('localhost','myuser_mydbuser','mypassword');
  3. if(!$db) echo "Cannot connect to the database - incorrect details";
  4. mysql_select_db('myuser_mydbname'); $result=mysql_query('show tables');
  5. while($tables = mysql_fetch_array($result)) {
  6. foreach ($tables as $key => $value) {
  7. mysql_query("ALTER TABLE $value COLLATE utf8_general_ci");
  8. }}
  9. echo "The collation of your database has been successfully changed!";
  10. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement