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

Class: mySQL

Source Location: /includes/classes/mySQL.class.php

Class Overview


HOWTO


Variables

Methods



Class Details

[line 36]
HOWTO



[ Top ]


Class Variables

$connection =

[line 43]

The connection resource id


Type:   object


[ Top ]

$isConnected =

[line 64]

Flag that tells if you are connected to the database or not


Type:   boolean


[ Top ]

$isLocked =

[line 71]

Flag that tells if you the tables are locked or not


Type:   boolean


[ Top ]

$queryType =

[line 78]

This will indicate what querytype the last query was


Type:   string


[ Top ]

$result =

[line 57]

The result from a select-query


Type:   object


[ Top ]

$selectedDb =

[line 50]

The selected database


Type:   object


[ Top ]



Class Methods


constructor __construct [line 93]

boolean __construct( string $sHost, string $sUser, string $sPassword, [string $sDatabase = ""], [boolean $bPersistant = TRUE])

This is the constructor of this mysql class.

It creates a connection to the database, and if possible it sets the database to You can specify if you want to use persistant connections or not.




Tags:

return:  TRUE when connection was successfull
access:  public


Parameters:

string   $sHost   The host to the mySQL server
string   $sUser   The username you use to log on to the mySQL server
string   $sPassword   The password you use to log on to the mySQL server
string   $sDatabase   The name of the database you wish to use
boolean   $bPersistant   TRUE if you want to use persistant connections. Default is TRUE

[ Top ]

destructor __destruct [line 125]

void __destruct( )

This is the destructor of this class. It frees the result of a query, it unlocks all locked tables and close the connection to the database It does not return anything at all, so you will not know if it was sauccessfull



Tags:

access:  public


[ Top ]

method closeConnection [line 336]

void closeConnection( )

The function unlocks tables if there are locked tables and the closes the connection to the database.



Tags:

access:  public


[ Top ]

method es [line 434]

boolean es( $string)

Alias for escapeString()



Tags:

return:  TRUE if there are locked tables


Parameters:

   $string  

[ Top ]

method escapeString [line 425]

boolean escapeString( $string)

Returns TRUE if there is any locked tables



Tags:

return:  TRUE if there are locked tables


Parameters:

   $string  

[ Top ]

method execute [line 181]

void execute( $sql)



Parameters:

   $sql  

[ Top ]

method fetchArray [line 249]

array fetchArray( [ $result = FALSE])

This function returns the query result as an array for each row in the query result



Tags:

access:  public


Parameters:

   $result  

[ Top ]

method fetchObject [line 271]

object fetchObject( )

This function returns the query result as an object for each row in the query result



Tags:

access:  public


[ Top ]

method fetchRow [line 284]

array fetchRow( )

This function returns the query result as an array for each row in the query result



Tags:

access:  public


[ Top ]

method freeResult [line 142]

void freeResult( )

This function frees the result from a query if there is any result.



Tags:

access:  public


[ Top ]

method getConnected [line 315]

boolean getConnected( )

This function returns a flag so you can see if you are connected to the database or not



Tags:

return:  TRUE when connected to the database
access:  public


[ Top ]

method getLocked [line 416]

boolean getLocked( )

Returns TRUE if there is any locked tables



Tags:

return:  TRUE if there are locked tables


[ Top ]

method getMysqlError [line 474]

mixed getMysqlError( )

Returns any mysql-error



Tags:

return:  String with the error if there is any error. Otherwise it returns FALSE


[ Top ]

method getMysqlErrorNo [line 461]

mixed getMysqlErrorNo( )

Returns any mysql-error number



Tags:

return:  String with the error if there is any error. Otherwise it returns FALSE


[ Top ]

method getNumRows [line 223]

mixed getNumRows( )

This function returns number of rows got when executing a query



Tags:

return:  FALSE if there is no query-result. If the queryType is SELECT then it will use the function MYSQL_NUM_ROWS Otherwise it uses the MYSQL_AFFECTED_ROWS
access:  public


[ Top ]

method getQueryResult [line 239]

object getQueryResult( )

The function returns the result from a call to the query() function



Tags:

access:  public


[ Top ]

method printError [line 444]

void printError( string $text, [boolean $killApp = FALSE])

Prints an error to the screen. Can be used to kill the application



Parameters:

string   $text   The text to display
boolean   $killApp   TRUE if you want to kill the application. Default is FALSE

[ Top ]

method query [line 158]

boolean query( string $query, [bool $IgnoreErrors = FALSE])

This function executes a query to the database.

The function does not return the result of the query, you must call the function getQueryResult() to fetch the result




Tags:

return:  TRUE if the query was successfull
access:  public


Parameters:

string   $query   The query-string to execute
bool   $IgnoreErrors   Whether to ignore errors if encoutered. Good for catching duplicate errors and not logging them

[ Top ]

method query_result [line 258]

void query_result( )



[ Top ]

method setConnected [line 326]

void setConnected( $bStatus $bStatus)

This function sets the flag so you can see if you are connected to the database



Tags:

access:  public


Parameters:

$bStatus   $bStatus   The status of the connection. TRUE if you are connected, FALSE if you are not

[ Top ]

method setDb [line 297]

boolean setDb( $sDatabase)

This function sets the database



Tags:

return:  TRUE if the database was set
access:  public


Parameters:

   $sDatabase  

[ Top ]

method setLocked [line 407]

void setLocked( boolean $bStatus)

Sets the flag that indicates if there is any tables locked



Parameters:

boolean   $bStatus   The flag that will indicate the lock. TRUE if locked

[ Top ]

method setReadLock [line 388]

boolean setReadLock( string $sTable)

This functions sets read lock to specified table(s)



Tags:

return:  TRUE on success


Parameters:

string   $sTable   a string containing the table(s) to read-lock

[ Top ]

method setWriteLock [line 398]

boolean setWriteLock( string $sTable)

This functions sets write lock to specified table(s)



Tags:

return:  TRUE on success


Parameters:

string   $sTable   a string containing the table(s) to read-lock

[ Top ]

method unlock [line 352]

void unlock( )

Unlocks all tables that are locked



Tags:

access:  public


[ Top ]


Documentation generated on Thu, 01 Jan 2009 14:04:21 -0800 by phpDocumentor 1.4.2