Forked from Beteha/models/Model.php to standalone public library TPsoft/DBmodel,

added creator for build MODEL class,
added basic tests
This commit is contained in:
2025-05-27 23:48:20 +02:00
parent 874e2bab95
commit 4b00166f43
6 changed files with 1903 additions and 1 deletions

28
test/test1.php Normal file
View File

@ -0,0 +1,28 @@
<?php
require_once __DIR__.'/../src/DBmodel.php';
$db = new \TPsoft\DBmodel\DBmodel('mysql:host=127.0.0.1;dbname=test;charset=utf8mb4', 'test', 'test');
// test query
$result = $db->query("show tables");
print_r($result);
// test results
$result = $db->getAll("show databases");
print_r($result);
$result = $db->getAll("show tables");
print_r($result);
$result = $db->getCol("show tables");
print_r($result);
$result = $db->getTableColumns("test");
print_r($result);
$result = $db->getRow("select * from test where id = 10");
print_r($result);
?>