1. Go to this page and download the library: Download kadiaak/rowbase-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kadiaak / rowbase-php example snippets
use Rowbase\Client;
$rowbase = new Client('rowb_…'); // ou Client::fromEnv() avec ROWBASE_API_KEY
$sheet = $rowbase->sheet('contacts', 'sheet-1');
// Lire
foreach ($sheet->all() as $record) {
echo $record['Email'], PHP_EOL;
}
// Créer
$record = $sheet->create([
'ID' => 'ref-2026-001',
'Date' => '2026-04-01 02:35:53',
'Website' => 'example.com',
'Email' => '[email protected]',
]);
// Mettre à jour, puis supprimer
$sheet->update($record->id, ['Website' => 'example.com']);
$sheet->delete($record->id);
use Rowbase\Query;
$page = $sheet->list(
Query::make()
->pageSize(50) // 1 à 100
->fields('ID', 'Email') // colonnes renvoyées
->sortDesc('Date') // tris empilables
->maxRecords(200)
);
$page->records; // list<Record>
$page->hasMore(); // reste-t-il des pages ?
$page->offset; // curseur de la page suivante
// Ligne par ligne, toutes pages confondues (générateur : mémoire constante)
foreach ($sheet->all() as $record) { /* … */ }
// Page par page, pour traiter par lots de 100
foreach ($sheet->pages() as $page) {
traiter($page->records);
}
// Tout charger d'un coup (attention à la volumétrie)
$records = $sheet->toArray(Query::make()->maxRecords(500));
$record = $sheet->find('0c8f2b16-1f3e-4a91-9a0c-2b7d0f5c8ab1'); // 404 => NotFoundException
$record = $sheet->findOrNull($id); // null si absente
$record = $sheet->first(Query::make()->sortDesc('Date')); // la plus récente