Update SQL and move pdo from sql to php