$input = "John's BBQ Shack"; $escaped_input = db_quote($input); $query = "INSERT INTO restaurants (name) VALUES ('$escaped_input')"; $result = db_query($query);
$name = "John"; $age = 30; $stmt = db_prepare("SELECT * FROM users WHERE name = ? AND age = ?"); $rows = db_execute($stmt, array($name, $age)); foreach ($rows as $row) { echo $row['name'] . " is " . $row['age'] . " years old. "; }In this example, the `db_prepare()` function is used to create a prepared statement with two placeholders that will be filled in with the `$name` and `$age` variables. The `db_execute()` function is then used to execute the statement, passing in an array with the values to replace the placeholders. The `$rows` variable contains the result of the query in the form of an array of associative arrays, which can be looped through and printed out. The PHP Database Quote library is typically included as part of a larger database library or framework, such as PDO or Laravel.