I got this code
$i = -1;
$random_string = array();
while (sizeof($random_string) < 1600000) {
$i++;
$zmienna = generatePassword();
if (!in_array($zmienna, $random_string))
$random_string[$i] = $zmienna;
else
continue;
}
//print_r($random_string);
foreach ($random_string as $value) {
$sql = "INSERT INTO `kody`(`kod`) VALUES ('$value')";
mysql_query($sql, $con);
}
But it will take a lot of hours to insert it to databse, or even to array. Do someone know how to improve this code?
mysql_functions! They are deprecated, unmaintained and will be removed in a future version of PHP.mysql_*functions. They're being deprecated. Instead use PDO (supported as of PHP 5.1) or mysqli (supported as of PHP 4.1). If you're not sure which one to use, read this article.