Database connection interface
This defines the public methods for making a connection with a database, executing queries, getting information about the query result and closing the connection.
category | Database |
---|---|
package | Formaid |
author | Dieter Adriaenssens |
copyright | 2006-2013 Dieter Adriaenssens |
license | GPL |
link | http://formaid.sourceforge.net/ |
affectedRows() : int
int
returns number of affected rowsclose() : bool
bool
is true when closing is successful.connect(string $server, string $username, string $password, string $database) : bool
string
Hostname or IP address of the database server
string
Username to connect to the database server
string
Password to login to the database server
string
Database
bool
is true when connection was made succesfullyescapeString(string $string) : string
string
string to be escaped
string
escaped string.lastInsertId() : int
int
returns ID for an AUTO_INCREMENT field of last executed querynumRows(mixed $result) : int
mixed
result of a SQL query
int
number of rowsquery(string $query) : \result
string
SQL query
\result
result of queryselectDb(string $database) : bool
string
Database name
bool
is true when switching the database was succesful