Can anyone help me out here?
Code: Select all
//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++;
}
}all fields in the database are not null tho. let me try to explain better what i'm trying to do. I'll include a SS of the database and a SS of the output and better try to explain what i want the output to come out as.
ok so as you can see in the database i have multiply monsters with the level of 2 and 63 as well as all of the other levels. All i'm trying to do is list all the numbers 2-99 that are not taken already so i know which levels i still need to add. So if the output as is, i'm trying to get the output to be like...
6 - 7 - 8 - 9 - 11 - 12 - 14 .. ect
because these are the levels i have not yet created monsters for.. i hope that this makes it easier. Thanks for the reply and i hope someone knows how to do this!