zualex / sqlcvs
PHP class for working SQL and CVS
1.0.0
2016-11-03 12:52 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: 5.5.*
This package is not auto-updated.
Last update: 2025-01-27 16:16:07 UTC
README
PHP class for working SQL and CVS.
Exmaple
require_once __DIR__ . '/vendor/autoload.php'; use \SqlCvs\SqlCvs; $sqlCvs = new SqlCvs('mysql:dbname=test_db;host=127.0.0.1', 'root', ''); $table = 'my_table2'; if (!$sqlCvs->isExistTable($table)) { $sqlCvs->import($table, 'tests/example.cvs'); } $sqlCvs->setTable($table); $row = $sqlCvs->getRandomRow(); if (count($row)) { $sqlCvs->update($row['id'], ['status' => 1]); echo $row['value']; }