Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. // Don't forget to enter your db infos.
  3.  
  4. define('THIS_SCRIPT', 'convert');
  5. require './global.php';
  6.  
  7. //---------------
  8.  
  9. header('Content-type: text/plain');
  10.  
  11. $dbconn = mysql_connect('localhost', 'vb385_user', 'PDJPGHts') or die( mysql_error() );
  12. mysql_select_db("pes5_vb385");
  13.  
  14. $sql = "ALTER DATABASE `pes5_vb385` DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci";
  15. $result = mysql_query($sql) or die( mysql_error() );
  16. print "Database changed to latin\n";
  17.  
  18. $sql = 'SHOW TABLES';
  19. $result = mysql_query($sql) or die( mysql_error() );
  20.  
  21. while ( $row = mysql_fetch_row($result) )
  22. {
  23. $table = mysql_real_escape_string($row[0]);
  24. $sql = "ALTER TABLE $table DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci, CONVERT TO CHARACTER SET latin1 COLLATE latin1_general_ci";
  25. mysql_query($sql) or die( mysql_error() );
  26. print "$table changed to latin.\n";
  27. }
  28.  
  29. mysql_close($dbconn);
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement