Some Bug Fix and Add DataBase Test

Fix the bug  display the right character
Add DataBase Test in fortest.php