eval() takes a string argument and evaluates it as PHP code. Consequently, it can lead to potential security problems, and almost never needs to be used. The code snippet you gave shows a misuse of eval(). It can be more simply written:
while ( $row=$results->fetchRow(DB_FETCHMODE_ASSOC) ){
$name = "maid$row[MA_ID]"; // example: $name = 'maid55'
$name = $$name;
if ( $name == 1 ){
// rest of code
}
}
But now, the above code shows an unnecessary use of variable variables. It would be better for $maid to be an array, upon which one can write:
while ( $row=$results->fetchRow(DB_FETCHMODE_ASSOC) ){
// Assuming MA_ID is not a defined constant, but a string index.
if ( $maid[$row['MA_ID']] == 1 ){
// rest of code
}
}