Download the PHP package mistevs/fluentpdo without Composer
On this page you can find all versions of the php package mistevs/fluentpdo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mistevs/fluentpdo
More information about mistevs/fluentpdo
Files in mistevs/fluentpdo
Package fluentpdo
Short Description FluentPDO is small PHP library for rapid query building. Killer feature is smart join builder which generates joins automatically.
License Apache-2.0 GPL-2.0+
Homepage https://github.com/qikdev/fluentpdo
Informations about the package fluentpdo
FluentPDO
FluentPDO - smart SQL builder for PHP.
FluentPDO is small PHP library for rapid query building. Killer feature is "Smart join builder" which generates joins automatically.
Features
- Fluent interface for creating queries step by step
- Smart join builder
- Simple API based on PDO and SQL syntax
- Build SELECT, INSERT, UPDATE & DELETE queries
- Small and fast
- Type hinting with code completion in smart IDEs
- Requires PHP 5.3+ with any database supported by PDO
Reference
Sitepoint - Getting Started with FluentPDO
Install
Composer
The preferred way to install FluentPDO is via composer. v1.1.x will be the last until the release of 2.0, so we recommend using 1.1.* to ensure no breaking changes are introduced.
Add in your composer.json
:
"require": {
...
"fpdo/fluentpdo": "1.1.*"
}
then update your dependencies with composer update
.
Copy
If you are not familiar with composer just copy /FluentPDO
directory into your libs/
directory then:
Start usage
First example
FluentPDO is easy to use:
executed query is:
Smart join builder (how to build queries)
If you want to join table you can use full sql join syntax. For example we would like to show list of articles with author name:
It was not so much smart, was it? ;-) If your database uses convention for primary and foreign key names, you can write only:
Smarter? May be. but best practice how to write joins is not to write any joins ;-)
All three commands create same query:
Simple CRUD Query Examples
SELECT
INSERT
UPDATE
DELETE
Note: INSERT, UPDATE and DELETE will be executed after ->execute()
:
Full documentation can be found on the FluentPDO homepage
Licence
Free for commercial and non-commercial use (Apache License or GPL).