我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

ORM:PHP中的数据库连接管理

I'm trying to build my own ORM (just for fun, not that I have to) in PHP, but I'm struggling a bit in managing database connection:

If I had some models like User, Post ... which are tables in the database, would it be okay to make a connection and close it every single time that I want something from the database or find a way to start up a single connection when the app boots and then just paste that connection whenever needed?

近期文章

  • 我如何使用正则表达式? (PHP)
  • html IMG标签如何打破这个php邮件功能?
  • 为什么我在Redhat linux中遇到CodeIgniter REST_Controller错误
  • 如何在php中为每个循环组合并设置两个数组?
  • ios Ad hoc发行
  • 日期过滤查询不起作用
  • 改进用于向Android设备发送通知的php页面
  • PHP cURL在Facebook中登录和发布或更新状态,无需使用API​​或SDK
  • 使用count()输出每月的总条目数以及月份
  • 我有包含html表单元素与PHP,但不发布
  • 在CakePHP公共类变量中连接常量和字符串
  • Wordpress WPAlchemy预览按钮
  • 如何使用服务器端处理(PHP)填充jquery数据表?
  • Laravel与Patchwork UTF8的问题
  • Imagecreatefromjpeg显示资源错误
  • Brandwatch php的HTTP API请求
  • php和oracle之间的连接
  • 关于icecandidate和webrtc的sdp的一些问题
  • memory_get_usage(true)vs Yii Debugger
  • cakePHP使用两个控制器进行路由

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华