dev-master
9999999-dev https://github.com/lcloss/php-sqlSimple SQL class to use with PHP
MIT
The Requires
- php >=7.0
by Luciano Closs
sql database driver database access
Simple SQL class to use with PHP
A simple Class to work with SQL in PHP, (*1)
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system., (*2)
You will need a web server and PHP configured. Also, you need to use one of these databases systems: * MariaDB or MySql * SQL Server * SQLite, (*3)
This project is intended to be incorporated into another project, so the minimum prerequisite is the web server, PHP and a Database driver as mentioned above., (*4)
Installation with Git:, (*5)
git clone https://github.com/lcloss/php-sql.git
Instalação com o Composer:, (*6)
composer require lcloss/php-sql
If you are using MariaDb, MySQL or SQL Server, you need to create the database schema first., (*7)
With your data, write:, (*8)
$sql = new Sql(); $results = $sql->query("SELECT * FROM table WHERE id = :id", [ ':id' => 1 ]); if ( count($results) > 0 ) { echo 'Found!'; } else { echo 'Not Found...'; }
### Returning Data$sql = new Sql(); $sql->query("UPDATE table SET name = :name WHERE id = :id", [ ':id' => 1, ':name' => 'New name', ]);
### Executing SQL Type the following code:
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us., (*9)
We use GitHub for versioning. For the versions available, see the tags on this repository., (*10)
See also the list of contributors who participated in this project., (*11)
This project is licensed under the MIT License - see the LICENSE.md file for details, (*12)
Simple SQL class to use with PHP
MIT
sql database driver database access