It is slightly better. $enabled[0] is the array which represents the first row though. If you want to find if there are rows then you need to check count($result) where $result is returning result from queryDB. OR you need to change queryDB to return only 1 row and also return count(*) and then you can always access $result[0]