Bug fix and PDO switch

Bug fix: rating, faq rating
Added PDO to retrieve_tickets, only2 functions left
Function Check