znframework/package-database

ZN 框架数据库包

8.7.2 2023-11-30 18:07 UTC

README

ZN 框架数据库包

请按照以下步骤进行安装和使用。

安装

您只需要运行以下代码即可进行安装。

composer require znframework/package-database

文档

点击此处查看您库的文档。

示例用法

以下展示了基本级别的使用方法。

<?php require 'vendor/autoload.php';

ZN\ZN::run();

# The default settings are in the ZN\Database\DatabaseDefaultConfiguration file. 
# You can make your settings in this file.
# The Config::set() method should be used if you need to configure settings externally.
Config::database('database', 
[
    'driver'   => 'mysqli',
    'host'     => 'localhost', 
    'database' => 'test',
    'user'     => 'root',
    'password' => '',
    'prefix'   => ''
]);

$persons = DB::persons();

Output::display($persons->result());