Class miStaticDBUtil

Description

A proxy class that has static methods to access the preconfigured database connection The database connection is configured using the following settings: MI_DEFAULT_DB_HOST, MI_DEFAULT_DB_USER, MI_DEFAULT_DB_PASS and MI_DEFAULT_DB_NAME

  • copyright: Copyright (c) 2003-2006 Mirchev Ideas Ltd. All rights reserved.

Located in /database/StaticDBUtil.php (line 22)


	
			
Method Summary
static void execDelete (string $table, string $key, int $keyval)
static int execInsert (string $table, array $values)
static array execSelect (string $query, [array $params = array()])
static array execSelectAndGetFields (string $query,  &$fieldsArray, array $fieldsArray)
static resource &execSQL (string $query)
static int execSQLInsert (string $query)
static void execUpdate (string $table, array $values, string $key, int $keyval)
static object object getDBUtil ()
static array &getTableFields (string $table)
static false ping ()
Methods
static method execDelete (line 164)

Executes a SQL delete query for a specify record key

  • throws: miDBException
  • access: public
static void execDelete (string $table, string $key, int $keyval)
  • string $table: database table name
  • string $key: name of the key field
  • int $keyval: value of the key field
static method execInsert (line 131)

Executes a SQL insert query from an associative array.

Associative array is representing one record where keys are the table fields names.

  • return: the ID generated for an AUTO_INCREMENT column by the previous INSERT query or 0 if the previous query does not generate an AUTO_INCREMENT value
  • throws: miDBException
  • access: public
static int execInsert (string $table, array $values)
  • string $table: table name
  • array $values: associative arrays with data for inserting
static method execSelect (line 97)

Returns an array with associative arrays from the result

  • return: array with associative arrays from the result
  • throws: miDBException
  • access: public
static array execSelect (string $query, [array $params = array()])
  • string $query: query string
  • array $params: positional query params (optional)
static method execSelectAndGetFields (line 112)

Executes the select query and also returns the selected column names in the $fieldsArray

  • return: array with associative arrays from the result
  • throws: miDBException
  • access: public
static array execSelectAndGetFields (string $query,  &$fieldsArray, array $fieldsArray)
  • string $query: query string
  • array $fieldsArray: array for names of the fields
  • &$fieldsArray
static method execSQL (line 67)

Executes a SQL query

  • return: Resource identifier or true depending on the query
  • throws: miDBException
  • access: public
static resource &execSQL (string $query)
  • string $query: query string
static method execSQLInsert (line 82)

Executes a SQL insert query

  • return: the ID generated for an AUTO_INCREMENT column by the previous INSERT query or 0 if the previous query does not generate an AUTO_INCREMENT value
  • throws: miDBException
  • access: public
static int execSQLInsert (string $query)
  • string $query: query string
static method execUpdate (line 148)

Executes a SQL update query from an array for a specify record key

  • throws: miDBException
  • access: public
static void execUpdate (string $table, array $values, string $key, int $keyval)
  • string $table: database table name
  • array $values: associative arrays with data for updating
  • string $key: name of the key field
  • int $keyval: value of the key field
static method getDBUtil (line 34)

Returns an object of class miDBUtilImpl

Object of class miDBUtilImpl or its subclasses is needed to handle the connection between database and miStaticDBUtil class

  • return: of class miDBUtilImpl or its subclasses
  • access: public
static object object getDBUtil ()
static method getTableFields (line 178)

Returns an array with names of the fields in the specified table.

  • return: array with names of the fields
  • throws: miDBException
  • access: public
static array &getTableFields (string $table)
  • string $table: database table name
static method ping (line 54)

Ping the database and attempt to reconnect if necessary

  • return: on failure, true on success
  • throws: miDBException
  • access: public
static false ping ()

Documentation generated on Thu, 08 May 2008 16:57:41 +0300 by phpDocumentor 1.4.1