A simple update to James L. script - a loop script to check if the database has a login ID. If exists, will add +1 after logging in:
$key = true; $a = 1; $login_test_origin=$login_test; while($key){ $query_test="SELECT count(*) as 'all' FROM user WHERE login='$login_test'"; $row_test=mysql_fetch_array(mysql_query($query_test)); $error=$row_test[all]; if($error > 0) { $key = true; $login_test=$login_test_origin.$a; $a++; } else { $key = false; $login=$login_test; } } echo"Used login ID: $login";
Martin macak
source share