Download the PHP package advmaker/fluentpdo without Composer
On this page you can find all versions of the php package advmaker/fluentpdo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download advmaker/fluentpdo
More information about advmaker/fluentpdo
Files in advmaker/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 http://fluentpdo.com/
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.1+ with any database supported by PDO
Reference
Sitepoint - Getting Started with FluentPDO
Install
Composer
The preferred way to install FluentPDO is via composer.
Add in your composer.json
:
"require": {
...
"lichtner/fluentpdo": "dev-master"
}
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).