当前位置:网站首页>PHP数据库连接version1.1
PHP数据库连接version1.1
2022-06-25 18:19:00 【幻丶城】
最近这个月过得确实有点狼狈。。。。不停地复习,看书。。终于到今天为止考完了2科了。能让我好好地写写博客了。。前段时间的PHP课设我多学了点东西,在我们一般老师讲的php连接数据库方面做了一些优化。前段时间发了第一个版本的,耦合度有点高。问了老师,我仿照着java的数据库连接池的方式我也写了一个。。。比较基础的连接方式。
第一个是XML文件。。只需要修改这里面的对应的,DB_HOST,DB_USER,DB_PWD 即可。
这是主要控制连接的文件。。。
$file文件填写文件名字。创建的.xml文件的文件名字。
完成以上操作之后。。。
使用这句话。
就可以建立数据库连接。。。
在此自己还可以再写一个文件,定义一些默认的方法。。更大限度减少代码量。。
额。。。。。。。。。。。。。。就到这里吧。。。。估计后面也没什么时间折腾php了。。要好好搞java咯。。。。
边栏推荐
- [deeply understand tcapulusdb technology] cluster management operation
- Good news | Haitai Fangyuan has passed the cmmi-3 qualification certification, and its R & D capability has been internationally recognized
- Article 7: there is no code prompt in clion,,,
- 【深入理解TcaplusDB技术】集群管理操作
- What is an operator?
- Sword finger offer double pointer
- 踩坑记录---线程池拒绝策略引起的一系列巧合
- RMAN backup database_ Duplexing backup sets
- C#泛型类案例
- Redis command string
猜你喜欢

Dell R530内置热备盘状态变化说明
![[in depth understanding of tcapulusdb technology] form creation and approval of document acceptance](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[in depth understanding of tcapulusdb technology] form creation and approval of document acceptance

Redis 5.0 data structure double end linked list source code analysis

LeetCode力扣(剑指offer 26-30)26. 树的子结构 27. 二叉树的镜像 28. 对称的二叉树 29. 顺时针打印矩阵 30. 包含min函数的栈

158_模型_Power BI 使用 DAX + SVG 打通制作商业图表几乎所有可能

【深入理解TcaplusDB技术】一键安装Tmonitor后台

Redis configuration (Internet access, password)

【深入理解TcaplusDB技术】 Tmonitor模块架构

158 Bar _ Modèle Power bi utilise Dax + SVG pour créer des diagrammes d'affaires presque toutes les possibilités

Use pagoda to set up mqtt server
随机推荐
Interrupt operation: abortcontroller learning notes
[in depth understanding of tcapulusdb technology] tcapulusdb regular documents
RMAN备份数据库_跳过脱机,只读和不可访问的文件
Training of long and difficult sentences in postgraduate entrance examination day91
Detailed explanation of route add command
【深入理解TcaplusDB技术】单据受理之创建业务指南
Redis configuration (Internet access, password)
【深入理解TcaplusDB技术】TcaplusDB构造数据
LeetCode力扣(剑指offer 26-30)26. 树的子结构 27. 二叉树的镜像 28. 对称的二叉树 29. 顺时针打印矩阵 30. 包含min函数的栈
[deeply understand tcapulusdb technology] tmonitor module architecture
[deeply understand tcapulusdb technology] table management of document acceptance
【深入理解TcaplusDB技术】单据受理之创建游戏区
07 local method stack
【深入理解TcaplusDB技术】集群管理操作
JSP page running but displaying source code
[deeply understand tcapulusdb technology] tcapulusdb import data
华为云SRE确定性运维专刊(第一期)
【ELT.ZIP】OpenHarmony啃论文俱乐部—见证文件压缩系统EROFS
Batch uploading of local jar packages to nexus private server
[in depth understanding of tcapulusdb technology] how to realize single machine installation of tmonitor