PDO interaction shared among classes
问题 I have a class for each database table I have, for example events table's rows are stored in Event classes. For each class I write, there are several methods that are exactly the same just with different variables or column names. For example: Player class update() public function update() { $conn = new PDO( db_host, db_user, db_pw ); $sql = "UPDATE players SET name=:name, picture=:picture, position=:position, num=:num, team=:team, description=:description WHERE id = :id"; $st = $conn-