Exception from a query

package salt\sql
inherited_from \salt\SaltException

 Methods

Create a new DBException

__construct(string $message, string $query, \PDOException $previous = NULL

Parameters

$message

string

Exception message

$query

string

the SQL query

$previous

\PDOException

previous exception

Retrieve SQL text of the query

getQuery() : string

Returns

stringsql query text

Retrieve exception code

getSqlStateErrorCode() : string

Returns

stringsql SQLSTATE error code

 Properties

 

sql query

$query : string

Default

 

SQLSTATE error Code

$sqlStateErrorCode : string

Default

NULL

 Constants

 

<p>SQLSTATE exception code returned by \PDOException if table does not exists</p>

TABLE_DOES_NOT_EXISTS = '42S02' : string