Class AMysql_Exception
MySQL exception class
A list of error codes can be found below. Anything in ($#), where # is a
number which represents the index the substring is captured in in the array
$this->getParams() returns.
CODE_DUPLICATE_ENTRY (1062): Duplicate entry '($0)' for key '($1)'
CODE_PARENT_FOREIGN_KEY_CONSTRAINT_FAILS (1451): Cannot delete or update a
parent row: a foreign key constraint fails ($0)
CODE_CHILD_FOREIGN_KEY_CONSTRAINT_FAILS (1452): Cannot add or update a child
row: a foreign key constraint fails (%0) CODE_SERVER_GONE_AWAY (2006): Mysql
server has gone away
List of official MySQL error codes can be found on these links:
- Exception
- RuntimeException
- AMysql_Exception
Author: Szerémi Attila
Link: http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html
Link: Visit https://github.com/amcsi/amysql
Located at AMysql/Exception.php
public
|
|
public
|
|
public
|
|
public
array|string
|
|
public
|
#
triggerErrorOnce( )
Performs a trigger_error on this exception. Does nothing if this method has already been called on this object. |
public
|
getCode(),
getFile(),
getLine(),
getMessage(),
getPrevious(),
getTrace(),
getTraceAsString()
|
integer |
CODE_DUPLICATE_ENTRY
|
1062 |
|
integer |
CODE_PARENT_FOREIGN_KEY_CONSTRAINT_FAILS
|
1451 |
|
integer |
CODE_CHILD_FOREIGN_KEY_CONSTRAINT_FAILS
|
1452 |
|
integer |
CODE_SERVER_GONE_AWAY
|
2006 |
public
string
|
$query |
|
#
The query string mysql had a problem with (if there is one). |
protected
integer
|
$errorTriggered | 0 |
|
protected
mixed
|
$params |
|
$code,
$file,
$line,
$message
|