承接 simpl/sql 相关项目开发

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

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

simpl/sql

Composer 安装命令:

composer require simpl/sql

包简介

A dead-simple layer on top of PDO to make PDO setup and querying simpler

README 文档

README

Build Status

A dead-simple layer on top of PDO to make PDO setup and querying simpler

This component makes it easy to make and execute SQL statements with PDO.

You can run parameterized queries in a single step instead of doing separate prepare and execute statements.

This will automatically convert your query to a prepared statement with parameterized queries to prevent nasty SQL injection attacks.

Installation

composer require simpl/sql

Usage

Connecting to the database.

Basic connection

$db = new \Simpl\SQL('localhost', 'your-db-name', 'your-username', 'your-password');

Connection with configuration array.

$config = [
    'prefix' => 'mysql',
    'host' => 'localhost',
    'port' => 3306,
    'dbname' => 'your-db-name',
    'username' => 'your-username',
    'password' => 'your-password'
];
$db = new \Simpl\SQL($config);

Running a SELECT query with parameters.

$res = $db->query('select * from test where foo = ? or bar = ?', [$foo, $bar]);

Since this is just a wrapper around PDO, you'll get back a \PDOStatement object you can then operate on as you normally would.

See https://simpl-php.com/components/sql for full documentation.

Coding Standards

This library uses PHP_CodeSniffer to ensure coding standards are followed.

I have adopted the PHP FIG PSR-2 Coding Standard EXCEPT for the tabs vs spaces for indentation rule. PSR-2 says 4 spaces. I use tabs. No discussion.

To support indenting with tabs, I've defined a custom PSR-2 ruleset that extends the standard PSR-2 ruleset used by PHP_CodeSniffer. You can find this ruleset in the root of this project at PSR2Tabs.xml

Codesniffer

composer codensiffer

Codefixer

composer codefixer

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固