$sql = "DELETE FROM users WHERE id = 5"; $affectedRows = $conn->exec($sql); echo "Deleted $affectedRows rows from the users table";
$sql = "INSERT INTO products (name, price) VALUES ('Product A', 10.99), ('Product B', 5.99)"; $affectedRows = $conn->exec($sql); echo "Inserted $affectedRows rows into the products table";This example inserts two records into the `products` table and returns the number of affected rows. By looking at the code examples, we can determine that the package library being used is the Doctrine DBAL library, which is a database abstraction layer that provides a set of PHP classes for interacting with databases. It helps to simplify the process of executing queries and provides a consistent interface across different database platforms.