Hi i need help with this if statement, i want it to reconise if a field in my table is empty, if it is i want it to echo 'NO CODE 2' and if it has data i want it to echo '<textarea>$codes2</textarea>'

At the moment, its only doing the else echo statement on both empty and non empty fields? Can anyone point me in the right direction?

Thanks in advance for any help.

PHP Code:
"SELECT * FROM codes_table WHERE id=".$_GET['id'];
$rs $db->Execute$sql );
$codes2 $rs->fields['codes2'];

if (
$codes2 === 'NULL'){
"NO CODE 2";
} else {