Firstly, I want to report a case in order to avoid misunderstandings.
For the sqlite extension, I mention the Sqlite extension, such as FTS, and not the PHP sqlite extension.
I use PDO Sqlite in my application, it cannot be changed.
As I saw here , Sqlite extensions can be downloaded as a request, presented below:
SELECT load_extension('xyz.so'); $db = new PDO ( 'sqlite:qwert.db' ); $db->query("SELECT load_extension('myextension.so');"); $db->query("SELECT myfunction(name) FROM table"); $rows = $db->fetchAll(PDO::FETCH_CLASS, 'stdClass');
Note: myfunction - myextension method
But when I test this request from PDO, it returns an unauthorized message.
For testing purposes, I tried the PHP Sqlite3 extension to load the extension using the code below:
$db = new SQLite3('qwer.db'); $db->loadExtension('xyz.so');
Working
As I know, PDO Sqlite does not have a method like loadExtension for loading extensions
Any idea how I can handle this?
Webolizer
source share