Skip to content
Snippets Groups Projects
Commit ddcbd774 authored by Carsten  Rose's avatar Carsten Rose
Browse files

PhpDoc for new marked SQL error.

parent 405053cc
No related branches found
No related tags found
No related merge requests found
Pipeline #1423 passed
......@@ -136,10 +136,11 @@ class AbstractException extends \Exception {
$arrMerged = OnArray::htmlentitiesOnArray(array_merge($arrMsg, $arrDebugShow));
if (!empty($os = $arrMerged[ERROR_MESSAGE_OS] ?? '')) {
// [ mysqli: 1146 ] Table 'crose_qfq_db.ksajfdkhaskf' doesn't exist
// [ mysqli: 1146 ] Table 'qfq_db.UNKNOWN_TABLE' doesn't exist
$before=$this->getTableToken( html_entity_decode($arrMerged[ERROR_MESSAGE_OS],ENT_QUOTES));
$arrMerged[EXCEPTION_SQL_FINAL] = $this->sqlHighlightError($arrMerged[ERROR_MESSAGE_OS], 'mysqli: 1146', $arrMerged[EXCEPTION_SQL_FINAL], $before, "' doesn't exist");
$arrMerged[EXCEPTION_SQL_FINAL] = $this->sqlHighlightError($arrMerged[ERROR_MESSAGE_OS], 'mysqli: 1064', $arrMerged[EXCEPTION_SQL_FINAL], "the right syntax to use near '", "' at line [0-9]*$");
// [ mysqli: 1054 ] Unknown column 'noPsp.pspElement' in 'field list'
$arrMerged[EXCEPTION_SQL_FINAL] = $this->sqlHighlightError($arrMerged[ERROR_MESSAGE_OS], 'mysqli: 1054', $arrMerged[EXCEPTION_SQL_FINAL], "Unknown column '", "' in 'field list'");
}
......@@ -173,6 +174,10 @@ class AbstractException extends \Exception {
}
/**
* Extract 'beforeMatch', incl. dynamic db name as token to do underlining later.
* E.g.: "[ mysqli: 1146 ] Table 'qfq_db.UNKNOWN_TABLE' doesn't exist"
* return: "Table 'qfq_db."
*
* @param $os
* @return string
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment