phpDocumentor db
[ class tree: db ] [ index: db ] [ all elements ]

Class: Connection

Source Location: /myphp-1.9/myphp-1.9-db/html/mysql/Connection.php

Class Connection

Class Overview

The connection interface towards the mysql database

  1. Usage:
  2. $connection = new Connection($host,$username,$password,$database,$persistent);
  3. $connection->open(); // Conect to the host and select the database to use
  4. : // Use the connection to operate on table data
  5. : // Free the resources
  6. $connection->close(); // Remember to release the connection
  7.  
  8. NOTE: The username/password are defined in an external file

Located in /myphp-1.9/myphp-1.9-db/html/mysql/Connection.php [line 36]

Object
   |
   --Connection
Author(s):
Information Tags:
Todo:  Register function, when closing page

Properties

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Object

Object::$cachefile
Object::$html
Object::$sql

Inherited From Object

Object::Object()
Constructor
Object::addHtml()
Add the current html to the SourceCode object
Object::getCacheFileName()
Returns the name of the cache file name
Object::getClassName()
Returns the name of the instanciated class
Object::getHtml()
Returns the html for the element
Object::getMsg()
Get the formatted message and debug level and Log to file ?
Object::save()
Save the SQL cache file
Object::setCacheFileName()
Set the path/name of the cache file
Object::toString()
Returns the information for this class
Object::write()
Write the content to the file opened by fp

[ Top ]
Property Summary
mixed   $anyerrors  
mixed   $connection  
mixed   $database  
mixed   $host  
mixed   $message  
mixed   $password  
mixed   $persistent  
mixed   $username  

[ Top ]
Method Summary
Connection   Connection()   Constructor
boolean   close()   Close the connection to the database
resource   getConnection()   Get the connection to the database
String   getDatabase()   Get the name of the database
String   getError()   Get the error message
String   getMessage()   Get all message
boolean   open()   Connect to the host, and select the database to use
void   setMessage()   Set next message in this scenario

[ Top ]
Properties
mixed   $anyerrors = false [line 45]

[ Top ]
mixed   $connection = NULL [line 43]

[ Top ]
mixed   $database = '' [line 40]

[ Top ]
mixed   $host = '' [line 37]

[ Top ]
mixed   $message = '' [line 44]

[ Top ]
mixed   $password = '' [line 39]

[ Top ]
mixed   $persistent = '' [line 41]

[ Top ]
mixed   $username = '' [line 38]

[ Top ]
Methods
Constructor Connection  [line 55]

  Connection Connection( String $host, String $username, String $password, String $database, [String $persistent = '']  )

Constructor

Parameters:
String   $host:  The server to connect to
String   $username:  The username
String   $password:  The password (secret, don't look)
String   $database:  The database to use
String   $persistent:  Use persistent connection (true) or not (false)


[ Top ]
close  [line 110]

  boolean close( )

Close the connection to the database


API Tags:
Return:  Returns TRUE on success or FALSE on failure


[ Top ]
getConnection  [line 94]

  resource getConnection( )

Get the connection to the database


API Tags:
Return:  The connection to the database or NULL


[ Top ]
getDatabase  [line 102]

  String getDatabase( )

Get the name of the database


API Tags:
Return:  The name of the database, specified in the constructor


[ Top ]
getError  [line 120]

  String getError( )

Get the error message


API Tags:
Return:  The resulting error message from the last mysql call


[ Top ]
getMessage  [line 133]

  String getMessage( )

Get all message


API Tags:
Return:  All messages from this scenario


[ Top ]
open  [line 67]

  boolean open( )

Connect to the host, and select the database to use


API Tags:
Return:  Returns TRUE on success or FALSE if failure


[ Top ]
setMessage  [line 141]

  void setMessage( String $message  )

Set next message in this scenario

Parameters:
String   $message:  The message to store


[ Top ]

Documentation generated on Thu, 22 Dec 2005 17:03:43 +0100 by phpDocumentor 1.3.0RC3