SQLite has it's own query escaping function, sqlite_escape_string() that in addition to simple data escaping will also encode binary data.

<?php
    $db 
sqlite_open("/path/to/database") or die($error);

    
$query 'BEGIN;';
    for (
$i 0$i 10$i++) {
        
$query .= "INSERT INTO tbl VALUES(".sqlite_escape_string($_POST['field_'.$i]).");";
    }
    
$query .= "COMMIT;"
    
sqlite_query($query$db);
?>