This guide connects to a SurrealDB instance with version 1 of the PHP SDK and runs a few basic operations.
1. Install the SDK
Follow the installation guide to add the SDK to your project, then include the autoloader and import the Surreal class.
2. Connect and select a namespace
Connect to the instance, then select a namespace and database with use().
3. Authenticate
Sign in with your credentials. See Authentication for namespace, database, and record access.
4. Create and read records
Use create() to add a record and select() to read it back.
5. Run SurrealQL
Use query() for raw SurrealQL, passing variables as the second argument.