SHARE
TWEET

Untitled

a guest May 23rd, 2018 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $database_name=’dbname’;
  4. $database_username=’dbusername’;
  5. $database_password=’dbpassword’;
  6.  
  7. $connection = mysql_connect(‘localhost’,$database_username,$database_password);
  8.  
  9. if(!$connection) {
  10. echo “Cannot connect to the database – incorrect details”;
  11. }else{
  12. mysql_select_db($database_name);
  13. $result=mysql_query(‘show tables’);
  14.  
  15. while($tables = mysql_fetch_array($result)) {
  16.  
  17. foreach ($tables as $key => $value) {
  18. mysql_query(“ALTER TABLE “.$value.” COLLATE utf8_general_ci”);
  19. }
  20. }
  21.  
  22. echo “Successfull collation change!”;
  23.  
  24. }
  25. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top