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

Class: Dba

Source Location: /lib/class/dba.class.php

Class Overview


Dba


Variables

Methods



Class Details

[line 33]
Dba

This is the database abstraction class It duplicates the functionality of mysql_??? with a few exceptions, the row and assoc will always return an array, simplifying checking on the far end it will also auto-connect as needed, and has a default database simplifying queries in most cases.




[ Top ]


Class Variables

static $stats = array('query'=>0)

[line 35]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


static method affected_rows [line 188]

static void affected_rows( $resource)

affected_rows

This emulates the mysql_affected_rows function




Tags:

access:  public


Parameters:

   $resource  

[ Top ]

static method dbh [line 269]

static void dbh( [ $database = ''])

dbh

This is called by the class to return the database handle for the specified database, if none is found it connects




Tags:

access:  public


Parameters:

   $database  

[ Top ]

static method disconnect [line 292]

static void disconnect( [ $database = ''])

disconnect This nukes the dbh connection based, this isn't used very often...



Tags:

access:  public


Parameters:

   $database  

[ Top ]

static method error [line 324]

static void error( )

error

this returns the error of the db




Tags:

access:  public


[ Top ]

static method escape [line 114]

static void escape( $var)

escape

This runs a escape on a variable so that it can be safely inserted into the sql




Tags:

access:  public


Parameters:

   $var  

[ Top ]

static method fetch_assoc [line 127]

static void fetch_assoc( $resource)

fetch_assoc

This emulates the mysql_fetch_assoc and takes a resource result we force it to always return an array, albit an empty one




Tags:

access:  public


Parameters:

   $resource  

[ Top ]

static method fetch_row [line 144]

static void fetch_row( $resource)

fetch_row

This emulates the mysql_fetch_row and takes a resource result we force it to always return an array, albit an empty one




Tags:

access:  public


Parameters:

   $resource  

[ Top ]

static method finish [line 177]

static void finish( $resource)

finish

This closes a result handle and clears the memory assoicated with it




Tags:

access:  public


Parameters:

   $resource  

[ Top ]

static method insert_id [line 313]

static void insert_id( )

insert_id

This emulates the mysql_insert_id function, it takes an optional database target




Tags:

access:  public


[ Top ]

static method num_rows [line 162]

static void num_rows( $resource)

num_rows

This emulates the mysql_num_rows function which is really just a count of rows returned by our select statement, this doesn't work for updates or inserts




Tags:

access:  public


Parameters:

   $resource  

[ Top ]

static method query [line 56]

static void query( $sql)

query

This is the meat of the class this does a query, it emulates The mysql_query function




Tags:

access:  public


Parameters:

   $sql  

[ Top ]

static method read [line 92]

static void read( $sql)

read

This is a wrapper for query, it's so that in the future if we ever wanted to split reads and writes we could




Tags:

access:  public


Parameters:

   $sql  

[ Top ]

static method reset_db_charset [line 402]

static void reset_db_charset( )

reset_db_charset

This cruises through the database and trys to set the charset to the current site charset, this is an admin function that can be run by an administrator this can mess up data if you switch between charsets that are not overlapping a catalog verify must be re-run to correct them




Tags:

access:  public


[ Top ]

static method show_profile [line 251]

static void show_profile( )

show_profile

This function is used for debug, helps with profiling




Tags:

access:  public


[ Top ]

static method translate_to_mysqlcharset [line 348]

static void translate_to_mysqlcharset( $charset)

translate_to_mysqlcharset

This translates the specified charset to a mysqlcharset, stupid ass mysql demands that it's charset list is different!




Tags:

access:  public


Parameters:

   $charset  

[ Top ]

static method write [line 103]

static void write( $sql)

write

This is a wrapper for a write query, it is so that we can split out reads and writes if we want to




Tags:

access:  public


Parameters:

   $sql  

[ Top ]

static method _auto_init [line 335]

static void _auto_init( )

auto_init

This is the auto init function it sets up the config class and also sets the default database




Tags:

access:  public


[ Top ]


Documentation generated on Thu, 12 Feb 2009 07:59:56 +0900 by phpDocumentor 1.4.2