定制 reptily/db 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

reptily/db

Composer 安装命令:

composer require reptily/db

包简介

DB interface for MySQL

README 文档

README

convenient library to work with mysql for php

Install for composer

composer require reptily/db

Initialization module

require "./vendor/autoload.php";

$config = [
        "host" => "localhost",
        "login" => "root",
        "pwd" => "*******",
        "db" => "php_db_test"
        ];

$DB = new \openWeb\DB($config);

Create table

$table = [
                "id" =>[
                        "type"=>"int",
                        "count"=>11,
                        "isNull"=>false,
                        "autoIncrement"=>true
                ],
                "name"=>[]
        ];
$DB->Create("account",$table);

Insert value

$DB->account->Insert(["name"=>"user"]);

Select all rows and output to array

$row=$DB->account->Select()->getArray();
print_r($row);

Select all rows and output to json string

echo $DB->account->Select()->getJson();

Select table account only id colum

echo $DB->account->where(["id" => 1])->Select()->getJson();

Select table account only id colum

echo $DB->account->field(["id"])->Select()->getJson();

Select table account and where id = 1 and id = 3

echo $DB->account->where('or',["id" => 1],["id" => 3])->Select()->getJson();

Select table account only id colum and where id = 1

echo $DB->account->field(["name"])->where(["id" => 1])->Select()->getJson();

Select table account id and name colum and where id = 1

echo $DB->account->field(["id","name"])->where(["id" => 1])->Select()->getJson();

Select table account where id more 1

echo $DB->account->where("id > 1")->Select()->getJson();

Inner table blog

echo $DB->account->inner("blog")->on("id","id")->Select()->getJson();

Left table blog

echo $DB->account->left("blog")->on("id","id")->Select()->getJson();

Update values in table blog

$DB->blog->set(['name' => 'update'])->where(["id" => 2])->Update();

Delete values in table account

$DB->account->where(["id" => 1])->Delete()

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固