ratingthomas / sqlmanager
A small script that lets you easily interact with your mysql database
2.0.0
2023-09-04 20:18 UTC
Requires
- php: >=8.0.0
This package is not auto-updated.
Last update: 2024-09-17 01:03:18 UTC
README
SQLManager is a small script that lets you easily interact with your mysql database.
Features
- Easy to use
- Secure (SQL Injection prevention)
- Simple and fast
Installation
- Download the latest release with composer or from the releases page.
composer require ratingthomas/sqlmanager
- Put the script somewhere in your project.
- Add the following code:
<?php require('vendor/autoload.php'); use Ratingthomas\SQLManager\SQL; $sql = new SQL(); ?>
How to use
Here i will explain how you can use the script.
Connect to Database
$sql->connect("db_name", "db_username", "db_password", "db_name");
Get data from the dabatase
Example 1
$result = $sql->query("SELECT * FROM users WHERE userid = ? AND user_type = ?", ['1', 'superadmin'], true); print_r($result);
Example 2
$result = $sql->query("SELECT * FROM users", []); print_r($result);
Get the connection info.
$sql->displayconnection()