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
intreturns number of affected rowsclose() : bool
boolis true when closing is successful.connect(string $server, string $username, string $password, string $database) : bool
stringHostname or IP address of the database server
stringUsername to connect to the database server
stringPassword to login to the database server
stringDatabase
boolis true when connection was made succesfullyescapeString(string $string) : string
stringstring to be escaped
stringescaped string.lastInsertId() : int
intreturns ID for an AUTO_INCREMENT field of last executed querynumRows(mixed $result) : int
mixedresult of a SQL query
intnumber of rowsquery(string $query) : \result
stringSQL query
\resultresult of queryselectDb(string $database) : bool
stringDatabase name
boolis true when switching the database was succesful