Hey guys i'm trying to do something and i can't seem to get it done correctly. I have a preset amount of levels for a monster to be. These levels are 2-99. What i'm trying to do is go through each level 2-99, do a lookup in my monsters database, if the level is already there i would like nothing to happen, if the level is not there i'd like it to display the level so that i may know that i need to add a monster of this level. All the code is doing is listing the number all 2-99 and i only want it to list the numbers 2-99 that are already not used from the database.
Can anyone help me out here?
//we need a counter to go from 2 - 99
$count = 2;
while ($count <= 99){
$getlevels = 'select level from monsters';
DB::connect($DB_database);
$getlevelsresult = DB::query($getlevels, "get levels");
DB::close();
while ($row = mysql_fetch_assoc($getlevelsresult)) {
$levels = $row['level'];
}
if ($levels == $count){
$count++;
} else {
echo ''.$count.' -';
$count++;
}
}