Projects Directory : Convert Javascript Function TO SQL Function - Convert JavaScript to PHP