Download the PHP package peterujah/db-controller without Composer

On this page you can find all versions of the php package peterujah/db-controller. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package db-controller

DBController

DBController is a PHP PDO wrapper that provides a convenient way to interact with a database using the PDO extension.

Installation

You can install the package via Composer by running the following command:

USAGES

To use DBController, follow these easy steps.

  1. Create an instance of the DBController class by passing the database configuration as an array or a path to a configuration file that returns array.

Or extend \Peterujah\NanoBlock\DBController to set your connection details like below

Initialize your custom class

Now run query select, insert, update, delete etc.. using prepare statment

Or run query select, insert, update, delete etc.. using query

Customization

Customize the configuration or enable debugging as needed.

Error Handling

DBController provides error handling for database operations. You can retrieve the error information using the error() or errorInfo() methods.

Debugging

You can enable debugging mode to get more detailed information about the executed statements by calling the dumpDebug() method.

Methods

Use the various methods provided by the DBController class to interact with the database.

Options Description
prepare(string) Call "prepare" with sql query string to prepare query execution
query(string) Call "query" width sql query without "bind" and "param"
bind(param, value, type) Call "bind" to bind value to the pdo prepare method
param(param, value, type) Call "param" to bind parameter to the pdo statment
execute() Execute prepare statment
rowCount() Get result row count
getOne() Get one resault row, this is useful when you set LIMIT 1
getAll() Retrieve all result
getInt() Gets integer useful when you select COUNT()
getAllObject() Gets result object
getLastInsertedId() Gets list inserted id from table
free() Free database connection
dumpDebug() Dump debug sql query parameter
errorInfo() Print PDO prepare statment error when debug is enabled
error() Print connection or execution error when debug is enabled
setDebug(bool) Sets debug status
setConfig(array) Sets connection config array
conn() Retrieve DBController Instance useful when you call "setConfig(config)"

Configuration format

Connection config array example

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.

License


All versions of db-controller with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package peterujah/db-controller contains the following files

Loading the files please wait ....