->export()
Exports data from a table.
This method is only available on a remote database targeted with the http protocol.
Method Syntax
$db->export($username, $password);
Arguments
| Arguments | Type | Description |
|---|
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',
]);
$response = $db->export('admin', 'password');
$fp = fopen('exported_data.json', 'w');
fwrite($fp, $response);
fclose($fp);