->import()
Imports data into a table.
This method is only available on a remote database targeted with the http protocol.
Method Syntax
$db->import($content, $username, $password);
Arguments
| Arguments | Type | Description |
|---|
content required | string
| The content to import. |
username required | string
| The username to authenticate with. |
password required | string
| The password to authenticate with. |
Example
Example
$db->connect('http://localhost:8080', [
'namespace' => 'example',
'database' => 'example',
]);
$import = file_get_contents('data.surql');
$db->import($import, 'admin', 'password');