As with single functions, array retrieval can be combined with query execution for greater efficiency.

<?php
chdir
(dirname(__FILE__)); // pres2 hack

$db sqlite_open("./ip.db");
$res sqlite_array_query($db,
    
"SELECT ip_start, ip_end 
     FROM ip_ranges 
     WHERE country_code=(SELECT id FROM country_data WHERE country_name='NEW CALEDONIA')"
SQLITE_ASSOC);

echo 
'<pre>';
print_r($res);
echo 
'</pre>';
?>
Output