|
|
Home Manual 11. API Reference [REVIEW] database->stderr |
| [REVIEW] database->stderr |
|
|
|
|
Last reviewed: Not reviewed database->stderrReturns the last database error message in a standard format. The error number and error message are included. The SQL statement that caused the error may optionally be included. Syntaxstring stderr ( [ boolean $showSQL ] )
ExamplesExample: $query = "SELECT * FROM 'bad_table'"; $database->setQuery( $query ); $rows = $database->loadObjectList(); if ($database->getErrorNum()) { echo $database->stderr(); } which would output: DB function failed with error number 1064<br />
<font color="red">You have an error in your SQL syntax
near ''bad_table'' at line 1 SQL=SELECT * FROM 'bad_table'</font>
which would render as: You have an error in your SQL syntax near ''bad_table'' at line 1 SQL=SELECT * FROM 'bad_table' Please report any errors on this page to the Developer Documentation Forum. |
|
| Last Updated ( Sunday, 24 December 2006 ) |
| < Prev | Next > |
|---|





