I am creating an application using spatialite database. I checked couple of tutorial from internet. Most of them explains the same. But the problem is I need "libspatialite.so" extension library. I do not know how to get it.
So whenever i run my code it shows the following warning and error....
[Warning: SQLite3::query() [sqlite3.query]: Unable to prepare statement: 1, no such module:]
[Fatal error: Call to a member function fetchArray() on a non-object]
But my code looks OK. It looks like because of i could not load the extention "libspatialite.so"
I have given bellow, my code.
<?php
$db = new SQLite3('sixcommunes.sqlite');
$db->loadExtension('libspatialite.so');
$db->exec("SELECT InitSpatialMetadata()");
$rs = $db->query('SELECT sqlite_version()');
while ($row = $rs->fetchArray()) {
print "<h3>SpatialLite version: $row[0]</h3>";
}
$sql = "SELECT KOM_NAMN FROM '6communes_SWEREF99TM'";
$rs = $db->query($sql);
$msg = "";
while($row = $rs->fetchArray()){
$msg = $row[0];
print "<h3>$msg</h3>";
}
$db->close();
?>
