A super easy PHP Framework for web development!
https://github.com/exacti/phacil-framework
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.3 KiB
67 lines
1.3 KiB
3 years ago
|
<?php
|
||
|
|
||
|
/*
|
||
|
* Copyright © 2021 ExacTI Technology Solutions. All rights reserved.
|
||
|
* GPLv3 General License.
|
||
|
* https://exacti.com.br
|
||
|
* Phacil PHP Framework - https://github.com/exacti/phacil-framework
|
||
|
*/
|
||
|
|
||
|
namespace Phacil\Framework\Interfaces;
|
||
|
|
||
|
interface Databases {
|
||
|
|
||
|
/**
|
||
|
* Construct the connection.
|
||
|
*
|
||
|
* @param string $hostname
|
||
|
* @param string $username
|
||
|
* @param string $password
|
||
|
* @param string $database
|
||
|
* @param string $port Is optional
|
||
|
* @param string $charset Is optional
|
||
|
* @return void
|
||
|
* @throws Exception
|
||
|
*/
|
||
|
public function __construct($hostname, $username, $password, $database);
|
||
|
|
||
|
/**
|
||
|
* Execute the SQL Query.
|
||
|
*
|
||
|
* @param string $sql
|
||
|
* @return stdClass|true
|
||
|
* @throws Exception
|
||
|
*/
|
||
|
public function query($sql);
|
||
|
|
||
|
/**
|
||
|
* Important escape to prevent SQL injection.
|
||
|
*
|
||
|
* @param string $value
|
||
|
* @return string
|
||
|
*/
|
||
|
public function escape($value);
|
||
|
|
||
|
/**
|
||
|
* Gets the number of rows affected by the last operation
|
||
|
*
|
||
|
* @return int */
|
||
|
public function countAffected();
|
||
|
|
||
|
/**
|
||
|
* Gets the ID of the last inserted row or sequence of values
|
||
|
*
|
||
|
* @return int|string */
|
||
|
public function getLastId();
|
||
|
|
||
|
/**
|
||
|
* Check is connected on database
|
||
|
* @return bool */
|
||
|
public function isConnected();
|
||
|
|
||
|
/**
|
||
|
* Destroy the connection
|
||
|
*
|
||
|
* @return void */
|
||
|
public function __destruct();
|
||
|
}
|