PHP Classes

PHP DB Connection PDO: Query SQL database with parameters from .env files

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 178 All time: 8,739 This week: 101Up
Version License PHP version Categories
db-connection-pdo 1.0.0MIT/X Consortium ...5PHP 5, Databases, System information
Description 

Author

This package can query SQL databases with parameters from .env files.

It can establish a database connection using the PDO extension using connection parameters read from a .env configuration file.

The package can also execute several types of SQL queries using prepared statements, and query parameter values passed using arrays.

Currently, it can execute:

- Arbitrary SQL queries

- SELECT SQL queries and return the whole result set in an array

- Check if the database server is accessible by executing a SELECT query that does not return useful results

Innovation Award
PHP Programming Innovation award nominee
July 2022
Number 5
Many PHP applications need to access a database server and execute SQL queries to store and retrieve data in database table records.

If for some reason, the database server is not available for connection, any queries that the applications need to execute will fail with an error that may not be very clear what is the real cause.

This package provides a simple solution to check the availability of the database server.

It executes a dummy SQL query that is not useful for storing and retrieving data from the database server.

It only serves the purpose of checking if the database server is accessible.

Manuel Lemos
Picture of Mateo
  Performance   Level  
Name: Mateo <contact>
Classes: 23 packages by
Country: Peru Peru
Age: ???
All time rank: 20474 in Peru Peru
Week rank: 170 Up1 in Peru Peru Up
Innovation award
Innovation award
Nominee: 10x

Winner: 3x

  Files folder image Files (6)  
File Role Description
Files folder imagesrc (2 files)
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files (6)  /  src  
File Role Description
  Plain text file Connection.php Class Class source
  Plain text file Query.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:178
This week:0
All time:8,739
This week:101Up