* [ ] 在項目獲取操作數據庫的對象,需要在項目里面創建一個中間類
* [ ] 當數據庫配置 Mysql.php 里面的配置變更的時候,只修改對應的數據庫的中間類
* [ ] 使用場景:
* 假設項目目錄名為 [ project ],應用目錄名為 [ application ]
* 項目在服務器的路徑完整路徑為:/home/wwwroot/project/
* 假設服務器有 3 個數據庫,分別是: 用戶數據庫[user]、商品數據庫[goods] 、訂單數據庫[order]
* 假設 user 數據庫里面的表前綴統一為 user_
* goods 數據庫里面的表前綴統一為 goods_
* 訂單數據庫里面的表前綴統一為 order_
* 假設 user 數據庫有一張 user_account 表, 字段有 :uid、username
user_account 表
| uid | username |
| :---: | :---: |
| 1 | 張三 |
| 2 | 李四 |
| 3 | 隔壁老王 |
* goods 數據庫有一張 goods_category 表,字段有:category_id、category_name
goods_category 表
| category_id | category_name |
| :---: | :---: |
| 1 | 服裝|
| 2 | 保健品 |
| 3 | 家居 |
* order 數據庫有一張 order_list 表,字段有:order_id、order_no
order_list 表
| order_id | order_no |
| :---: | :---: |
| 1 | 20200409000001 |
| 2 | 20200409000002 |
| 3 | 20200409000003 |
* 要想在項目中分別操作這 3 個數據庫,需要在:/home/wwwroot/project/application/Lib/ 目錄下
* 創建操作數據庫中間類存儲目錄 mysql,完整路徑為:/home/wwwroot/project/application/Lib/mysql/
* 假設命名操作這 3 個數據庫的中間類文件分別為:User.php、Goods.php、Order.php
- 開始使用
- 配置文件
- 路由模式
- AutoLoad類
- 啟動文件
- __construct
- SetRouting
- SetAlias
- SetStop
- SetError
- Access
- SetWorker
- SetClassFile
- SetClassDir
- Run
- OpenLoad
- LinuxStartAll
- Session類
- 使用說明
- set
- get
- delete
- pull
- has
- id
- Cookie類
- 使用說明
- set
- get
- delete
- pull
- has
- TempLets類
- 模板語法
- 模板標簽
- html
- show
- assign
- obtain
- Request類
- get
- post
- host
- referer
- getip
- localip
- header
- body
- file
- scheme
- protocolversion
- uri
- path
- querystring
- method
- Response
- SendFile
- FileStream
- SendData
- SetStatus
- SetHead
- SetMime
- WebSend
- redirect
- dumpJson
- dump
- come
- ps
- Frame類
- GetWeb
- ViewFile
- RoutingData
- SetClassFile
- SetClassDir
- GetMime
- FileMime
- LoadDir
- StartDir
- IsJson
- ArrJson
- JsonFormat
- ObStart
- GetConfig
- ConfigDir
- TempDir
- GetRunData
- GetStatic
- IsDebug
- SetDebug
- GetDebugInfo
- GlobalVariables類
- 使用說明
- set
- get
- delete
- pull
- has
- id
- Mysql類
- 新版本
- 第三方
- Thinkorm
- Medoo
- 舊版本
- Mysql 配置格式
- 項目中操作數據庫
- 項目場景
- 項目數據庫配置
- 項目數據庫中間類
- 項目中操作數據表
- 連貫操作
- where
- table
- data
- order
- field
- limit
- page
- group
- having
- join
- tabname
- union
- sql
- link
- link_base
- lock
- CURD 操作
- 寫入數據
- 數據刪除
- 數據查詢
- 數據更新
- 數據統計操作
- count
- sum
- max
- min
- avg
- 操作DEMO
- CurdTrait.php
- 項目Model層操作表.md
- Curl類
- Method類
- SslAes類
- layui_zqadmin