2020-12-26 20:09:15 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
interface DBInterface
|
|
|
|
|
{
|
|
|
|
|
public function connect($host, $username, $password, $database, $port);
|
|
|
|
|
|
|
|
|
|
public function query(string $sql);
|
|
|
|
|
|
|
|
|
|
public function error(): string;
|
|
|
|
|
|
|
|
|
|
public function errno(): int;
|
|
|
|
|
|
|
|
|
|
public function numRows($result): int;
|
|
|
|
|
|
|
|
|
|
public function selectDb($database);
|
|
|
|
|
|
2021-01-04 20:47:22 +08:00
|
|
|
public function fetchAssoc($result);
|
2020-12-26 20:09:15 +08:00
|
|
|
|
2021-01-04 20:47:22 +08:00
|
|
|
public function fetchRow($result);
|
2020-12-26 20:09:15 +08:00
|
|
|
|
2021-01-04 20:47:22 +08:00
|
|
|
public function fetchArray($result, $type);
|
2020-12-28 02:14:41 +08:00
|
|
|
|
2020-12-26 20:09:15 +08:00
|
|
|
public function affectedRows(): int;
|
|
|
|
|
|
|
|
|
|
public function escapeString(string $string): string;
|
|
|
|
|
|
2020-12-28 20:52:54 +08:00
|
|
|
public function lastInsertId(): int;
|
|
|
|
|
|
2021-01-07 17:35:00 +08:00
|
|
|
public function freeResult($result);
|
|
|
|
|
|
2020-12-26 20:09:15 +08:00
|
|
|
}
|