Fix insert and update relations with PDO