mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 15:20:32 -04:00
22 lines
482 B
PHP
22 lines
482 B
PHP
<?
|
|
|
|
class Db{
|
|
public static function GetLastInsertedId(): int{
|
|
return $GLOBALS['DbConnection']->GetLastInsertedId();
|
|
}
|
|
|
|
/**
|
|
* @return Array<mixed>
|
|
*/
|
|
public static function Query(string $query, array $args = []): array{
|
|
if(!isset($GLOBALS['DbConnection'])){
|
|
$GLOBALS['DbConnection'] = new DbConnection(DATABASE_DEFAULT_DATABASE, DATABASE_DEFAULT_HOST);
|
|
}
|
|
|
|
if(!is_array($args)){
|
|
$args = [$args];
|
|
}
|
|
|
|
return $GLOBALS['DbConnection']->Query($query, $args);
|
|
}
|
|
}
|