As I just tried this and it does not seem to work still.
I have tried to change the default start number of '$i' but each time, it tells me it is available when in true fact, it is not.
$user = 'admin';
$i = 1001;
$query = "SELECT acct_user FROM clients WHERE acct_user != NULL"; //is SQL NOT equal <>?
$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
if (!isset($row['$user$i'])) { echo "$user$i is free<br>"; break;}
$i++;
}
You gave me this to try but as it is not working, I an seeing something wrong in the area of:
if (!isset($row['$user$i'])) { echo "$user$i is free<br>";
I am not a guru at this but from what I can tell, is it not looking for a field (column) named admin1001 ?