almost complete

refactor code, decide pdo or mysqli