Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- - Fix charges fori tems, we'll use the default charge (so we need to insert special table with item charges).
- - Quests
- */
- $update_file= "result.sql"; // File name
- function generateAccounts()
- {
- global $update_file;
- $SELECTSIZE = 7000;
- $run = 0;
- do
- {
- $sql = "SELECT `acct`,`login`,`encrypted_password`,`email`,`lastip`,`banned`,`lastlogin`,`muted` FROM `accounts` ORDER BY `acct` LIMIT ".($run*$SELECTSIZE).",$SELECTSIZE;";
- $result = mysql_query($sql);
- $final = "INSERT INTO `account` (`id`, `username`, `sha_pass_hash`, `email`, `last_ip`, `locked`, `last_login`, `expansion`, `mutetime`) VALUES ";
- while ($row = mysql_fetch_array($result, MYSQL_NUM))
- {
- $username = mysql_escape_string($row[1]);
- $password = mysql_escape_string($row[2]);
- $email = mysql_escape_string($row[3]);
- $final.= "('$row[0]','$username','$password','$email','$row[4]','$row[5]','$row[6]','2','$row[7]'),";
- }
- $final[strlen($final)-1] = ";";
- $final .="\n";
- $resultfile = fopen($update_file,"a") or die("noob");
- fputs($resultfile,$final);
- fclose($resultfile);
- $run++;
- } while(mysql_num_rows($result) >= $SELECTSIZE);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement