PHP code errors fix

Small code fix and added few TODO that must be done.
Add parameters for mysql function interface, pay attention to the rest.