https://github.com/martan03/php-database
PHP database object
https://github.com/martan03/php-database
database mysql mysql-database php php-databse phpmyadmin
Last synced: 2 months ago
JSON representation
PHP database object
- Host: GitHub
- URL: https://github.com/martan03/php-database
- Owner: Martan03
- License: mit
- Created: 2022-09-23T19:00:24.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-07T20:38:58.000Z (over 3 years ago)
- Last Synced: 2025-03-17T11:26:07.781Z (over 1 year ago)
- Topics: database, mysql, mysql-database, php, php-databse, phpmyadmin
- Language: PHP
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Database class
## Usage:
First you need to require database class:
```php
require_once("Db.php");
```
Then you can connect to the database. This is example on localhost:
```php
if (!Db::connect("127.0.0.1", "database_name", "root", ""))
{
header("Location: 500");
exit;
}
```
And now you can start using your database. This is example of getting all rows and columns from database:
```php
Db::queryAll("
SELECT *
FROM your_database
WHERE name = ?
", array("name"));
```
## List of features
- Connecting to database using PDO connection
- Executing query and:
- Getting number of effected rows
- Getting all effected rows
- Getting first effected row
- Getting first effected row's first column
- Easy to use insert and update functions