$pdo = new PDO("mysql:host=localhost;dbname=mydb", "username", "password"); $stmt = $pdo->prepare("SELECT * FROM users WHERE id = :id"); $stmt->bindParam(":id", $id, PDO::PARAM_INT); $id = 5; $stmt->execute(); $result = $stmt->fetchAll();In this example, we first create a PDO object to connect to the database. We then prepare the SELECT statement using a named parameter ":id" to indicate the placeholder for the value we will bind later. We bind the value of $id to the parameter using the bindParam method. We set the data type of the parameter to be an integer using PDO::PARAM_INT. Finally, we execute the statement and fetch all the rows using the fetchAll method. Package/Library: The PDO library is used in this example to connect to the database and prepare the SQL statement. PDO is an abstraction layer that provides a consistent interface to interact with different databases. It is a built-in extension in PHP 7 and is included in many PHP distributions.