sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); $start = 0; do { // Batch query for group members, call group_user_del $sql = "SELECT user_id, user_email FROM {$table_prefix}users LIMIT $start, 100"; $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) { do { $sql = "UPDATE {$table_prefix}users SET user_email_hash = " . (crc32(strtolower($row['user_email'])) . strlen($row['user_email'])) . ' WHERE user_id = ' . $row['user_id']; $db->sql_query($sql); $start++; } while ($row = $db->sql_fetchrow($result)); echo "
Batch -> $start\n"; flush(); } else { $start = 0; } $db->sql_freeresult($result); } while ($start); echo "

Done

\n"; ?>