Escape special characters for SQL statements.

Fixed #78. Also converted PHP MySQL API to mysqli.