What are some potential pitfalls to watch out for when using SQLite in PHP for data retrieval operations?

One potential pitfall when using SQLite in PHP for data retrieval operations is not properly sanitizing user input, which can lead to SQL injection attacks. To prevent this, always use prepared statements or parameterized queries to securely pass user input to the database.

// Using prepared statements to prevent SQL injection
$pdo = new PDO('sqlite:database.db');
$stmt = $pdo->prepare('SELECT * FROM users WHERE username = :username');
$stmt->bindParam(':username', $username);
$stmt->execute();
$results = $stmt->fetchAll();