select statements
prepare($sql_statement)
// Prepares the specified SQL statement for execution and returns a
// PDOStatement object. Within the SQL statement, you can use a
// colon (:) to add parameters to the statement.
bindValue($param, $value)
// Binds the specified value to the specified parameter in the prepared statement.
execute()
// Executes the prepared statement.
$query = "SELECT * FROM products";
$statement = $db->prepare($query);
$statement->execute();
$query = "SELECT * FROM products WHERE categoryID = :category_id";
$statement = $db->prepare($query);
$statement->bindValue(':category_id', $category_id);
$statement->execute();
prepare() method of the PDO object. It requires just one argument, which is the SQL statement to be executed.execute() method of the PDOStatement object.bind() method of the PDOStatement object.:) followed by the name of the parameter.