some changes.

fixes and some changes:
- use mysqli
- fix missing data.