1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-16 11:34:10 +02:00

Highlight line with error in SQL command

This commit is contained in:
Jakub Vrana
2012-04-15 23:37:05 -07:00
parent 4815c7d020
commit 047ce184f5
4 changed files with 23 additions and 7 deletions

View File

@@ -510,6 +510,16 @@ if (!defined("DRIVER")) {
return h(preg_replace('~^You have an error.*syntax to use~U', "Syntax error", $connection->error));
}
/** Get line of error
* @return int 0 for first line
*/
function error_line() {
global $connection;
if (ereg(' at line ([0-9]+)$', $connection->error, $regs)) {
return $regs[1] - 1;
}
}
/** Return expression for binary comparison
* @param string
* @return string