Have you checked out the api addon? It has auth features. Ive not looked much myself but it seems on the right path. Ill be using using something similar to tie the forum to a nodejs backend for real time items.
Hey, your question is more related to zend framework.
See this link for info http://stackoverflow.com/questions/1173690/how-to-set-a-value-to-null-when-using-zend-db
Hope it helps.