The advantage of PRAGMA is that it queries the database structure directly, rather than querying the data (which may not exist in an empty database, even though custom fields were created). I recommend Big Wolf's modified code (here) for those who are interested in this function.
↧