Convert database type to php

#2211