| abstract | |
|---|---|
| extends | XoopsDatabase | 
connection to a mysql database using MySQLi extension
| Methods | ||||||||
|---|---|---|---|---|---|---|---|---|
| 
					
	public
					
					
				 | connect(bool $selectdb = true): bool
		connect to the database
	 connect to the database Parameters
 Returnssuccessful? | # | ||||||
| 
					
	public
					
					
				 | genId(string $sequence): int
		generate an ID for a new row
	 generate an ID for a new row This is for compatibility only. Will always return 0, because MySQL supports autoincrement for primary keys. Parameters
 Returnsalways 0, because mysql has support for autoincrement | # | ||||||
| 
					
	public
					
					
				 | fetchRow(mysqli_result $result): array|false
		Get a result row as an enumerated array
	 Get a result row as an enumerated array Returnsfalse on end of data | # | ||||||
| 
					
	public
					
					
				 | fetchArray(mysqli_result $result): array|false
		Fetch a result row as an associative array
	 Fetch a result row as an associative array Returnsfalse on end of data | # | ||||||
| 
					
	public
					
					
				 | fetchBoth(mysqli_result $result): array|false
		Fetch a result row as an associative array
	 Fetch a result row as an associative array Returnsfalse on end of data | # | ||||||
| 
					
	public
					
					
				 | fetchObject(mysqli_result $result): stdClass|false
		XoopsMySQLDatabase::fetchObject()
	 XoopsMySQLDatabase::fetchObject() Returnsfalse on end of data | # | ||||||
| 
					
	public
					
					
				 | getInsertId(): int|string
		Get the ID generated from the previous INSERT operation
	 Get the ID generated from the previous INSERT operation | # | ||||||
| 
					
	public
					
					
				 | getRowsNum(mysqli_result $result): int
		Get number of rows in result
	 Get number of rows in result | # | ||||||
| 
					
	public
					
					
				 | getAffectedRows(): int
		Get number of affected rows
	 Get number of affected rows | # | ||||||
| 
					
	public
					
					
				 | close(): void
		Close MySQL connection
	 Close MySQL connection | # | ||||||
| 
					
	public
					
					
				 | freeRecordSet(mysqli_result $result): void
		will free all memory associated with the result identifier result.
	 will free all memory associated with the result identifier result. Parameters
 | # | ||||||
| 
					
	public
					
					
				 | error(): string
		Returns the text of the error message from previous MySQL operation
	 Returns the text of the error message from previous MySQL operation ReturnsReturns the error text from the last MySQL function, or '' (the empty string) if no error occurred. | # | ||||||
| 
					
	public
					
					
				 | errno(): int
		Returns the numerical value of the error message from previous MySQL operation
	 Returns the numerical value of the error message from previous MySQL operation ReturnsReturns the error number from the last MySQL function, or 0 (zero) if no error occurred. | # | ||||||
| 
					
	public
					
					
				 | quoteString(string $str): string
		Returns escaped string text with single quotes around it to be safely stored in database
	 Returns escaped string text with single quotes around it to be safely stored in database Parameters
 Returnsescaped string text with single quotes around | # | ||||||
| 
					
	public
					
					
				 | quote(string $string): string
		Quotes a string for use in a query.
	 Quotes a string for use in a query. Parameters
 | # | ||||||
| 
					
	public
					
					
				 | escape(string $string): string
		Escapes a string for use in a query. Does not add surrounding quotes.
	 Escapes a string for use in a query. Does not add surrounding quotes. Parameters
 | # | ||||||
| 
					
	public
					
					
				 | queryF(string $sql, int $limit = 0, int $start = 0): mysqli_result|bool
		perform a query on the database
	 perform a query on the database Parameters
 Returnsquery result or FALSE if successful or TRUE if successful and no result | # | ||||||
| 
					abstract
	public
					
					
				 | query(string $sql, int $limit = 0, int $start = 0): mysqli_result|bool
		perform a query
	 perform a query This method is empty and does nothing! It should therefore only be used if nothing is exactly what you want done! ;-) Parameters
 Returnsquery result or FALSE if successful or TRUE if successful and no result Implemented by | # | ||||||
| 
					
	public
					
					
				 | queryFromFile(string $file): bool
		perform queries from SQL dump file in a batch
	 perform queries from SQL dump file in a batch Parameters
 ReturnsFALSE if failed reading SQL file or TRUE if the file has been read and queries executed | # | ||||||
| 
					
	public
					
					
				 | getFieldName(mysqli_result $result, int $offset): string
		Get field name
	 Get field name Parameters
 | # | ||||||
| 
					
	public
					
					
				 | getFieldType(mysqli_result $result, int $offset): string
		Get field type
	 Get field type Parameters
 | # | ||||||
| 
					
	public
					
					
				 | getFieldsNum(mysqli_result $result): int
		Get number of fields in result
	 Get number of fields in result Parameters
 | # | ||||||
| 
					
	public
					
					
				 | getServerVersion(): string
		getServerVersion get version of the mysql server
	 getServerVersion get version of the mysql server | # | ||||||
| 
					
	public
					
					
				 | isResultSet(mixed $result): bool
		Test the passed result to determine if it is a valid result set
	 Test the passed result to determine if it is a valid result set Parameters
 Returnstrue if $result is a database result set, otherwise false Implements | # | ||||||
| Methods inherited from XoopsDatabase | 
|---|
| __construct(), setLogger(), setPrefix(), prefix(),  | 
| Properties | |||
|---|---|---|---|
| 
	public
					
					
				 | XoopsDatabase|mysqli | $conn | # | 
| Properties inherited from XoopsDatabase | 
|---|
| $prefix, $logger, $allowWebChanges |