承接 abbe98/simple-pdo 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

abbe98/simple-pdo

Composer 安装命令:

composer require abbe98/simple-pdo

包简介

A simpe PDO class for MariaDB and MySQL

README 文档

README

Secure and simple library for PHP's PDO class.

Installation

Install the composer package.

composer require abbe98/simple-pdo

In define your database connection/user details using constants:

const HOST = '' // the IP of the database
const DBNAME = '' // the database name to be used
const USERNAME = '' // the username to be used with the database
const PASSWORD = '' // the password to be used with the username

Usage Examples

Create new SimplePDO instance and open a connection:

$database = SimplePDO::getInstance();`

If there is already a open connection that one will be used automatically.

Query database and return a single row:

$database = SimplePDO::getInstance();
$database->query("SELECT `column` FROM `table` WHERE `columnValue` = :id");
$database->bind(':id', 123);
$result = $database->single();

Query database and return multiply rows:

$database = SimplePDO::getInstance();
$database->query("SELECT * FROM `table`");
$result = $database->resultSet();

Insert new row in database:

$database = SimplePDO::getInstance();
$database->query("INSERT INTO `users` (name, email) VALUES (:name, :email)");
$database->bind(':name', $name);
$database->bind(':name', $email);
$database->execute();

Update existing row:

$database = SimplePDO::getInstance();
$database->query("UPDATE `users` SET `name` = :name WHERE `id` = :id");
$database->bind(':name', $newName);
$database->bind(':id', $id);
$database->execute();

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-08-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固