PHP PDO code to SELECT and INSERT MySQL data