DB
[ class tree: DB ] [ index: DB ] [ all elements ]

Class: DB_odbc

Source Location: /DB-1.6.8/DB/odbc.php

Class Overview

PEAR
   |
   --DB_common
      |
      --DB_odbc

Database independent query interface definition for PHP's ODBC extension.


Author(s):

Version:

  • $Id: odbc.php,v 1.47 2004/10/04 17:14:32 danielc Exp $

Variables

Methods


Inherited Variables

Inherited Methods

Class: DB_common

DB_common::DB_common()
Constructor
DB_common::affectedRows()
Returns the affected rows of a query
DB_common::autoCommit()
enable automatic Commit
DB_common::autoExecute()
Automaticaly generate an insert or update query and call prepare() and execute() with it
DB_common::autoPrepare()
Automaticaly generate an insert or update query and pass it to prepare()
DB_common::buildManipSQL()
Make automaticaly an sql query for prepare()
DB_common::commit()
starts a Commit
DB_common::createSequence()
Creates a new sequence
DB_common::dropSequence()
Deletes a sequence
DB_common::errorCode()
Map native error codes to DB's portable ones
DB_common::errorMessage()
Map a DB error code to a textual message. This is actually just a wrapper for DB::errorMessage()
DB_common::errorNative()
Returns an errormessage, provides by the database
DB_common::escapeSimple()
Escape a string according to the current DBMS's standards
DB_common::execute()
Executes a DB statement prepared with prepare()
DB_common::executeMultiple()
This function does several execute() calls on the same statement handle
DB_common::freePrepared()
Free the resource used in a prepared query
DB_common::getAll()
Fetch all the rows returned from a query
DB_common::getAssoc()
Fetch the entire result set of a query and return it as an associative array using the first column as the key
DB_common::getCol()
Fetch a single column from a result set and return it as an indexed array
DB_common::getListOf()
list internal DB info valid values for $type are db dependent, often: databases, users, view, functions
DB_common::getOne()
Fetch the first column of the first row of data returned from a query
DB_common::getOption()
Returns the value of an option
DB_common::getRow()
Fetch the first row of data returned from a query
DB_common::getSpecialQuery()
Returns the query needed to get some backend info
DB_common::getTables()
DB_common::limitQuery()
Generates a limited query
DB_common::nextId()
Returns the next free id in a sequence
DB_common::numRows()
Returns the number of rows in a result object
DB_common::prepare()
Prepares a query for multiple execution with execute()
DB_common::provides()
Tell whether a DB implementation or its backend extension supports a given feature
DB_common::query()
Send a query to the database and return any results with a DB_result object
DB_common::quote()
DEPRECATED: Quotes a string so it can be safely used in a query
DB_common::quoteIdentifier()
Quote a string so it can be safely used as a table or column name
DB_common::quoteSmart()
Format input so it can be safely used in a query
DB_common::quoteString()
DEPRECATED: Quotes a string so it can be safely used within string delimiters in a query
DB_common::raiseError()
Communicate an error and invoke error callbacks, etc
DB_common::rollback()
starts a rollback
DB_common::setFetchMode()
Sets which fetch mode should be used by default on queries on this connection
DB_common::setOption()
Set run-time configuration options for PEAR DB
DB_common::tableInfo()
Returns information about a table or a result set

Class Details

[line 42]
Database independent query interface definition for PHP's ODBC extension.
  • Author: Stig Bakken <ssb@php.net>
  • Version: $Id: odbc.php,v 1.47 2004/10/04 17:14:32 danielc Exp $


[ Top ]


Class Variables

$connection =

[line 46]


Type:   mixed


[ Top ]

$dbsyntax =

[line 47]


Type:   mixed


[ Top ]

$phptype =

[line 47]


Type:   mixed
Overrides:   Array


[ Top ]

$row = array()

[line 48]


Type:   mixed


[ Top ]



Method Detail

DB_odbc (Constructor)   [line 53]

DB_odbc DB_odbc( )


[ Top ]

affectedRows   [line 318]

mixed affectedRows( )

Returns the number of rows affected by a manipulative query

(INSERT, DELETE, UPDATE)

  • Return: int affected rows, 0 when non manip queries or DB error on error

Overrides DB_common::affectedRows() (Returns the affected rows of a query)
[ Top ]

autoCommit   [line 512]

void autoCommit( [ $onoff = false])


Overrides DB_common::autoCommit() (enable automatic Commit)

Parameters:

   $onoff   — 

[ Top ]

commit   [line 523]

void commit( )


Overrides DB_common::commit() (starts a Commit)
[ Top ]

connect   [line 109]

int connect( $dsn $dsninfo, [$persistent $persistent = false])

Connect to a database and log in as the specified user.
  • Return: DB_OK on success, a DB error code on failure

Parameters:

$dsn   $dsninfo   —  the data source name (see DB::parseDSN for syntax)
$persistent   $persistent   —  (optional) whether the connection should be persistent

[ Top ]

createSequence   [line 481]

int createSequence( string $seq_name)

Creates a new sequence

Overrides DB_common::createSequence() (Creates a new sequence)

Parameters:

string   $seq_name   —  name of the new sequence

[ Top ]

disconnect   [line 170]

void disconnect( )


[ Top ]

dropSequence   [line 503]

int dropSequence( string $seq_name)

Deletes a sequence

Overrides DB_common::dropSequence() (Deletes a sequence)

Parameters:

string   $seq_name   —  name of the sequence to be deleted

[ Top ]

errorNative   [line 405]

int errorNative( )

Get the native error code of the last error (if any) that occured on the current connection.
  • Return: ODBC error code
  • Access: public

Overrides DB_common::errorNative() (Returns an errormessage, provides by the database)
[ Top ]

freeResult   [line 291]

void freeResult( $result)


Parameters:

   $result   — 

[ Top ]

nextId   [line 429]

int nextId( string $seq_name, [boolean $ondemand = true])

Returns the next free id in a sequence
  • Return: the next id number in the sequence. DB_Error if problem.
  • See: DB_common::nextID()
  • Access: public

Overrides DB_common::nextId() (Returns the next free id in a sequence)

Parameters:

string   $seq_name   —  name of the sequence
boolean   $ondemand   —  when true, the seqence is automatically created if it does not exist

[ Top ]

nextResult   [line 221]

true nextResult( a $result)

Move the internal odbc result pointer to the next available result
  • Return: if a result is available otherwise return false
  • Access: public

Parameters:

a   $result   —  valid fbsql result resource

[ Top ]

numCols   [line 300]

void numCols( $result)


Parameters:

   $result   — 

[ Top ]

numRows   [line 340]

the numRows( $result $result)

ODBC may or may not support counting rows in the result set of SELECTs.
  • Return: number of rows, or 0

Overrides DB_common::numRows() (Returns the number of rows in a result object)

Parameters:

$result   $result   —  the odbc result resource

[ Top ]

odbcRaiseError   [line 556]

object DB odbcRaiseError( [integer $errno = null])

Gather information about an error, then use that info to create a DB error object and finally return that object.

Parameters:

integer   $errno   —  PEAR error number (usually a DB constant) if manually raising an error

[ Top ]

quote   [line 390]

void quote( $str)

  • Deprecated: Deprecated in release 1.6.0

Overrides DB_common::quote() (DEPRECATED: Quotes a string so it can be safely used in a query)

Parameters:

   $str   — 

[ Top ]

quoteIdentifier   [line 367]

string quoteIdentifier( string $str)

Quote a string so it can be safely used as a table / column name

Quoting style depends on which dbsyntax was passed in the DSN.

Use 'mssql' as the dbsyntax in the DB DSN only if you've unchecked "Use ANSI quoted identifiers" when setting up the ODBC data source.

  • Return: quoted identifier string
  • Since: 1.6.0
  • Access: public

Overrides DB_common::quoteIdentifier() (Quote a string so it can be safely used as a table or column name)

Parameters:

string   $str   —  identifier name to be quoted

[ Top ]

rollback   [line 534]

void rollback( )


Overrides DB_common::rollback() (starts a rollback)
[ Top ]

simpleQuery   [line 190]

int simpleQuery( $query $query)

Send a query to ODBC and return the results as a ODBC resource identifier.
  • Return: returns a valid ODBC result for successful SELECT queries, DB_OK for other successful queries. A DB error code is returned on failure.

Parameters:

$query   $query   —  the SQL query

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:56:44 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.