If you're using a fairly new OACS (>4.5), you shouldn't probably be using ns_db at all, but something like db_multirow instead.
Please read the db api guide for getting a grasp of the new db api.