https://github.com/tina4stack/tina4php-odbc
ODBC database drivers for Tina4PHP
https://github.com/tina4stack/tina4php-odbc
Last synced: 3 months ago
JSON representation
ODBC database drivers for Tina4PHP
- Host: GitHub
- URL: https://github.com/tina4stack/tina4php-odbc
- Owner: tina4stack
- Created: 2021-10-21T08:35:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-15T09:01:14.000Z (almost 3 years ago)
- Last Synced: 2025-02-04T18:50:47.867Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 111 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tina4php-odbc
ODBC database driver for the Tina4 PHP framework.
## Installation
```bash
composer require tina4stack/tina4php-odbc
```
## Requirements
- PHP >= 8.1
- ext-odbc
- tina4stack/tina4php-database ^2.0
## Usage
```php
// Connection format: DSN name, username, password
$DBA = new \Tina4\DataODBC("DSN_NAME", "username", "password");
// Execute queries
$DBA->exec("create table users (id integer primary key, name varchar(200))");
$DBA->commit();
// Insert with parameters
$DBA->exec("insert into users (id, name) values (?, ?)", 1, "Alice");
// Fetch records
$result = $DBA->fetch("select * from users");
$records = $result->asArray();
// Fetch with limit and offset
$result = $DBA->fetch("select * from users", 10, 0);
// Fetch single record
$record = $DBA->fetchOne("select * from users where id = 1");
// Check if table exists
$exists = $DBA->tableExists("users");
// Get database metadata
$metadata = $DBA->getDatabase();
```
## Testing
```bash
docker compose up -d
composer test
```
## License
MIT - see [LICENSE](LICENSE)
---
## Our Sponsors
**Sponsored with 🩵 by Code Infinity**
[
](https://codeinfinity.co.za/about-open-source-policy?utm_source=github&utm_medium=website&utm_campaign=opensource_campaign&utm_id=opensource)
*Supporting open source communities • Innovate • Code • Empower*