Overview

Packages

  • Auth
    • Ads
    • Ldap
    • Xoops
  • Autotasks
  • Config
    • Category
    • Item
    • Option
  • Core
    • Filesystem
    • Filters
    • Logger
    • Mail
    • Message
    • Password
    • Security
    • StopSpammer
    • Template
    • Textsanitizer
    • VersionChecker
  • Data
    • Avatar
    • Comment
  • Database
    • Connection
    • Criteria
    • Legacy
    • MySQL
    • PDO
    • Updater
  • Feeds
    • RSS
  • File
  • Form
    • Base
    • Elements
  • ICMS
    • IPF
      • View
  • Image
    • Category
  • Ipf
    • Category
    • Controller
    • Export
    • form
    • Keyhighlighter
    • Member
    • Object
    • Permission
    • richfile
    • Tree
    • urllink
    • View
  • kernel
    • Set
  • Member
    • Group
    • GroupMembership
    • GroupPermission
    • User
  • Messaging
  • Module
  • None
  • Notification
  • Page
  • Plugins
    • Editor
  • Preload
    • Libraries
  • Privmessage
  • Session
  • SmartObject
  • View
    • Block
    • Breadcrumb
    • PageNav
    • PrinterFriendly
    • Template
    • Templates
    • Theme
    • Tree

Classes

  • icms_db_Connection
  • icms_db_Factory
  • icms_db_legacy_Factory

Interfaces

  • icms_db_IUtility
  • icms_db_legacy_IDatabase
  • Overview
  • Package
  • Class

Interface icms_db_legacy_IDatabase

Direct known implementers

icms_db_legacy_Database, icms_db_legacy_PdoDatabase

Indirect known implementers

icms_db_legacy_mysql_Database, icms_db_legacy_mysql_Proxy, icms_db_legacy_mysql_Safe
Package: Database
Category: ICMS
Copyright: http://www.impresscms.org/ The ImpressCMS Project
License: GNU General Public License (GPL)
Located at db/legacy/IDatabase.php
Methods summary
public
# setLogger( object $logger )

assign a icms_core_Logger object to the database

assign a icms_core_Logger object to the database

Parameters

$logger
reference to a icms_core_Logger object

See

icms_core_Logger
public
# setPrefix( string $value )

set the prefix for tables in the database

set the prefix for tables in the database

Parameters

$value
table prefix
public string
# prefix( string $tablename = '' )

attach the prefix.'_' to a given tablename.

attach the prefix.'_' to a given tablename.

if tablename is empty, only prefix will be returned

Parameters

$tablename
tablename

Returns

string
prefixed tablename, just prefix if tablename is empty
public boolean
# connect( boolean $selectdb = true )

connect to the database

connect to the database

Parameters

$selectdb
select the database now?

Returns

boolean
successful?
public integer
# genId( string $sequence )

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

$sequence
name of the sequence from which to get the next ID

Returns

integer
always 0, because mysql has support for autoincrement
public array
# fetchRow( resource $result )

Get a result row as an enumerated array

Get a result row as an enumerated array

Parameters

$result

Returns

array
the fetched rows
public array
# fetchArray( $result )

Fetch a result row as an associative array

Fetch a result row as an associative array

Returns

array
the fetched associative array
public array
# fetchBoth( $result )

Fetch a result row as an associative array and numerical array

Fetch a result row as an associative array and numerical array

Returns

array
the associative and numerical array
public integer
# getInsertId( )

Get the ID generated from the previous INSERT operation

Get the ID generated from the previous INSERT operation

Returns

integer
public integer
# getRowsNum( resource $result )

Get number of rows in result

Get number of rows in result

Parameters

$result
result

Returns

integer
the number of rows in the resultset
public integer
# getAffectedRows( )

Get number of affected rows

Get number of affected rows

Returns

integer
number of affected rows
public
# close( )

Closes MySQL connection

Closes MySQL connection

public boolean
# freeRecordSet( resource $result )

will free all memory associated with the result identifier result.

will free all memory associated with the result identifier result.

Parameters

$result
result

Returns

boolean
TRUE on success or FALSE on failure.
public string
# error( )

Returns the text of the error message from previous MySQL operation

Returns the text of the error message from previous MySQL operation

Returns

string
Returns the error text from the last MySQL function, or '' (the empty string) if no error occurred.
public integer
# errno( )

Returns the numerical value of the error message from previous MySQL operation

Returns the numerical value of the error message from previous MySQL operation

Returns

integer
Returns the error number from the last MySQL function, or 0 (zero) if no error occurred.
public string
# quoteString( string $str )

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

$str
unescaped string text

Returns

string
escaped string text with single quotes around
public string
# quote( string $string )

Quotes a string for use in a query using mysql_real_escape_string.

Quotes a string for use in a query using mysql_real_escape_string.

Parameters

$string
$str unescaped string text

Returns

string
escaped string text using mysql_real_escape_string
public resource
# queryF( string $sql, integer $limit = 0, integer $start = 0 )

perform a query on the database

perform a query on the database

Parameters

$sql
a valid MySQL query
$limit
number of records to return
$start
offset of first record to return

Returns

resource

query result or FALSE if successful or TRUE if successful and no result

public
# query( string $sql, integer $limit = 0, integer $start = 0 )

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

$sql
a valid MySQL query
$limit
number of records to return
$start
offset of first record to return
public string
# getFieldName( resource $result, integer $offset )

Get field name

Get field name

Parameters

$result
query result
$offset
field index

Returns

string
the fieldname
public string
# getFieldType( resource $result, integer $offset )

Get field type

Get field type

Parameters

$result
query result
$offset
numerical field index

Returns

string
the fieldtype
public integer
# getFieldsNum( resource $result )

Get number of fields in result

Get number of fields in result

Parameters

$result
query result

Returns

integer
number of fields in the resultset
API documentation generated by ApiGen