phpDocumentor sf-active
base_classes
[ class tree: sf-active ] [ index: sf-active ] [ all elements ]

Class: DB

Source Location: /classes/db_class.inc

Class DB

Class Overview

a wrapper around all database access.

class for interaction with a mysql-server.

Located in /classes/db_class.inc [line 21]



		
		
		
		

Methods

[ Top ]
Method Summary
DB   DB()   class constructor. does nothing.
void   close()   closes a mysql-connection.
void   error_num()   returns an error num as a negative number to distinguish it from an id (in the case of inserts)
int   execute_getnextkey()   treats a MySQL tabel as a sequence by inserting an empty row and getting the row id
int   execute_statement()   executes a SQL statement that doesn't have a return value
int   execute_statement_return_autokey()   runs a SQL statement for an INSERT and returns the ID of the row added
bool   get_connection()   returns a database connection
void   print_query()   prints a query, usefull for development/debugging.
array   query()   runs an sql statement and returns a list of dictionary objects representing the resultset.
array   query_retrieve_keyed_list()   Run a SQL statement and return a keyed dictionary representing the result set, with row 0 as the key, and row 1 as the value this is useful for retrieving an array to use for a SELECT box, e.g.

[ Top ]
Methods
Constructor DB  [line 28]

  DB DB( )

class constructor. does nothing.



[ Top ]
close  [line 178]

  void close( )

closes a mysql-connection.



[ Top ]
error_num  [line 168]

  void error_num( )

returns an error num as a negative number to distinguish it from an id (in the case of inserts)



[ Top ]
execute_getnextkey  [line 150]

  int execute_getnextkey( string $sequence_table  )

treats a MySQL tabel as a sequence by inserting an empty row and getting the row id

Parameters:
string   $sequence_table: 


[ Top ]
execute_statement  [line 117]

  int execute_statement( string $sql  )

executes a SQL statement that doesn't have a return value

Parameters:
string   $sql: 


[ Top ]
execute_statement_return_autokey  [line 135]

  int execute_statement_return_autokey( string $sql  )

runs a SQL statement for an INSERT and returns the ID of the row added

Parameters:
string   $sql: 


[ Top ]
get_connection  [line 37]

  bool get_connection( )

returns a database connection



[ Top ]
print_query  [line 187]

  void print_query( string $sql  )

prints a query, usefull for development/debugging.

Parameters:
string   $sql:  the query


[ Top ]
query  [line 65]

  array query( string $sql  )

runs an sql statement and returns a list of dictionary objects representing the resultset.

Parameters:
string   $sql: 


[ Top ]
query_retrieve_keyed_list  [line 98]

  array query_retrieve_keyed_list( string $sql  )

Run a SQL statement and return a keyed dictionary representing the result set, with row 0 as the key, and row 1 as the value this is useful for retrieving an array to use for a SELECT box, e.g.

WARNING: additional rows are discarded and selection order matters

Parameters:
string   $sql: 


[ Top ]

Documentation generated on Tue, 24 Jun 2008 01:03:06 -0700 by phpDocumentor 1.3.0RC3