Download the PHP package sheetdb/sheetdb-php without Composer
On this page you can find all versions of the php package sheetdb/sheetdb-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sheetdb/sheetdb-php
More information about sheetdb/sheetdb-php
Files in sheetdb/sheetdb-php
Package sheetdb-php
Short Description PHP Library for accessing google spreadsheet content via SheetDB. https://sheetdb.io
License MIT
Informations about the package sheetdb-php
PHP SheetDB Class
Installation
The SheetDB PHP Library is available through Composer
Test spreadsheet
At any time you can play with our test API here: https://sheetdb.io/api/v1/58f61be4dda40
You can also go to Google Sheets and play with it: https://docs.google.com/spreadsheets/u/2/d/1mrsgBk4IAdSs8Ask5H1z3bWYDlPTKplDIU_FzyktrGk/edit The spreadsheet resets every hour.
Basic usage
In order to instantiate SheetDB connection you need to give an api id. You can find it in SheetDB Dashboard.
Searching
You can use search method to find only specific rows. You have 2 options. Search rows that meets all of the conditions or search rows that meets at least one of the conditions.
You can use second parameter if you want the search to be case sensitive (it is boolean). By default it is not case sensitive.
Creating a row(s)
If you want to create a new row you'll need to pass an array with key_name => value. If you want to create multiple rows that should be an array of arrays.
Updating a row(s)
First two parameters are key and value that need to match, third argument is array similar to the create one.
Fourth parameter is optional. If it's true not specified values will be emptied.
Update the batch of rows in the spreadsheet
Update for various queries. First argument is data itself. Each object in it should have a query key with the actual query (for example, "id=5"), and the remaining keys will be updated, as in a regular PATCH / PUT request.
Second parameter is optional. If it's true not specified values will be emptied.
Delete a row(s)
Just like in update first two parameters are key and value. Every row that will match query will be deleted.