SGDatabase.php
5 years ago
SGDatabaseAdapterWordpress.php
5 years ago
SGIDatabaseAdapter.php
5 years ago
SGIDatabaseAdapter.php
49 lines
| 1 | <?php |
| 2 | |
| 3 | interface SGIDatabaseAdapter |
| 4 | { |
| 5 | /* |
| 6 | The query may contain any of the following placeholders: %s, %d and %f |
| 7 | The number of given parameters must be equal to the number of placeholders. |
| 8 | This method must return the fetched results if the query is fetchable. |
| 9 | */ |
| 10 | public function query($query, $params=array()); |
| 11 | |
| 12 | /* |
| 13 | Execute a query and return the statement object. |
| 14 | */ |
| 15 | public function exec($query); |
| 16 | |
| 17 | /* |
| 18 | Execute raw query. This function doesn't prepare the query, neither returns a statement object. |
| 19 | Perfect for executing fast insert queries without doing cleanup or escaping. |
| 20 | Returns true or false. |
| 21 | */ |
| 22 | public function execRaw($query); |
| 23 | |
| 24 | /* |
| 25 | Fetch a row from a previously executed query. |
| 26 | */ |
| 27 | public function fetch($st); |
| 28 | |
| 29 | /* |
| 30 | Return the last insert id. |
| 31 | */ |
| 32 | public function lastInsertId(); |
| 33 | |
| 34 | /* |
| 35 | Get the error (if any) generated by the most recent query. |
| 36 | */ |
| 37 | public function getLastError(); |
| 38 | |
| 39 | /* |
| 40 | Kill cached query results. |
| 41 | */ |
| 42 | public function flush(); |
| 43 | |
| 44 | /* |
| 45 | Escape value for sql query |
| 46 | */ |
| 47 | public function escapeSql($value); |
| 48 | } |
| 49 |