Download the PHP package riculum/php-pdo without Composer
On this page you can find all versions of the php package riculum/php-pdo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download riculum/php-pdo
More information about riculum/php-pdo
Files in riculum/php-pdo
Package php-pdo
Short Description A complete database toolkit written in PHP to handle MySQL statements
License MIT
Informations about the package php-pdo
PHP-PDO
A complete database toolkit written in PHP to handle PDO statements
Installation
Use the package manager composer to install the library
Initial setup
Credentials
The basic database settings can be set through environment variables. Add a .env
file in the root of your project. Make sure the .env
file is added to your .gitignore
so it is not checked-in the code. By default, the library looks for the following variables:
- DB_HOST
- DB_NAME
- DB_USERNAME
- DB_PASSWORD
More information how to use environment variables here
Configuration
Import vendor/autoload.php and load the .env
settings
Statements
The select
statement is used to return an array containing all the result set rows
The single
statement is used to fetch the next row from a result set
The insert
statement is used to insert new records in a table
The insertAssoc
statement is used to insert new records in a table using an associative array
The update
statement is used to modify the existing records in a table
The updateAssoc
statement is used to update records in a table using an associative array and a where clause
The delete
statement is used to delete existing records in a table
Use statement
for other operations not mentioned
Transactions
Transaction are used to run a series of operations within an entity. If an exception is thrown between beginTransaction
and commit
, the transaction will automatically be rolled back.
Bugreport & Contribution
If you find a bug, please either create a ticket in github, or initiate a pull request
Versioning
We adhere to semantic (major.minor.patch) versioning (https://semver.org/). This means that:
- Patch (x.x.patch) versions fix bugs
- Minor (x.minor.x) versions introduce new, backwards compatible features or improve existing code.
- Major (major.x.x) versions introduce radical changes which are not backwards compatible.
In your automation or procedure you can always safely update patch & minor versions without the risk of your application failing.