TLSQLException Class Reference

Default exception for SQL problems. If a query problem arises (mysql_query() returns false for instance), throw this exception with the mysql_error() and the query as parameters. More...

List of all members.

Public Member Functions

 __construct ($message, $query="")
 Construct a new SQLException.
 getQuery ()
 Return the query that caused this exception to be thrown.


Detailed Description

Default exception for SQL problems. If a query problem arises (mysql_query() returns false for instance), throw this exception with the mysql_error() and the query as parameters.

Example:

  $qry = "INSERT INTO foo VALUES (10, 'bar');
  $res = mysql_query($qry);
  if (!$res) { throw new SQLException(mysql_error(), $qry); }

Definition at line 848 of file tlib.php.


Constructor & Destructor Documentation

TLSQLException::__construct ( message,
query = "" 
)

Construct a new SQLException.

Parameters:
$message (string) The message for the exception. Usually the return value of mysql_error() is passed here.
$query (string) The query which contained the caused the error.

Definition at line 855 of file tlib.php.


Member Function Documentation

TLSQLException::getQuery (  ) 

Return the query that caused this exception to be thrown.

Returns:
(string) The query that caused this exception to be thrown.

Definition at line 864 of file tlib.php.


The documentation for this class was generated from the following file:
Generated on Sun Sep 24 22:05:25 2006 for TLib-PHP by  doxygen 1.4.7