diff --git a/.cvsignore b/.cvsignore
index c221041d0..583b5f841 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1,2 +1,3 @@
ChangeLog_till_2.2.6.tar.gz
config.inc.developer.php3
+phpmyadmin.wpj
\ No newline at end of file
diff --git a/config.inc.php3 b/config.inc.php3
index 64dd01f2a..41727dd60 100755
--- a/config.inc.php3
+++ b/config.inc.php3
@@ -226,6 +226,14 @@ $cfg['ModifyDeleteAtRight'] = FALSE; // show edit/delete links on right s
$cfg['DefaultDisplay'] = 'horizontal'; // default display direction (horizontal|vertical)
$cfg['RepeatCells'] = 100; // repeat header names every X cells? (0 = deactivate)
+$cfg['UseSyntaxColoring'] = TRUE; // use syntaxcoloring on output of SQL, might be a little slower
+// Colors used for Syntaxcoloring of SQL Statements
+$cfg['colorFunctions'] = 'red';
+$cfg['colorKeywords'] = 'blue';
+$cfg['colorStrings'] = 'green';
+$cfg['colorColType'] = '#FF9900';
+$cfg['colorAdd'] = '#9999CC';
+
/**
* MySQL settings
@@ -294,11 +302,62 @@ if ($cfg['ShowFunctionFields']) {
'TO_DAYS',
'UNIX_TIMESTAMP',
'USER',
- 'WEEKDAY'
+ 'WEEKDAY',
+ 'CONCAT'
);
} // end if
-
+if($cfg['UseSyntaxColoring']) {
+ $cfg['keywords']=array(
+ 'SELECT',
+ 'INSERT',
+ 'LEFT',
+ 'UPDATE',
+ 'REPLACE',
+ 'EXPLAIN',
+ 'FROM',
+ 'WHERE',
+ 'LIMIT',
+ 'INTO',
+ 'ALTER',
+ 'ADD',
+ 'DROP',
+ 'GROUP',
+ 'ORDER',
+ 'CHANGE',
+ 'CREATE',
+ 'DELETE'
+ );
+} // end if
+if($cfg['UseSyntaxColoring']) {
+ $cfg['additional']=array(
+ 'TABLE',
+ 'DEFAULT',
+ 'NULL',
+ 'NOT',
+ 'INDEX',
+ 'PRIMARY',
+ 'KEY',
+ 'UNIQUE',
+ 'BINARY',
+ 'UNSIGNED',
+ 'ZEROFILL',
+ 'AUTO_INCREMENT',
+ 'AND',
+ 'OR',
+ 'DISTINCT',
+ 'DISTINCTROW',
+ 'BY',
+ 'ON',
+ 'JOIN',
+ 'BETWEEN',
+ 'BETWEEN',
+ 'IN',
+ 'IF',
+ 'ELSE',
+ 'SET'
+ );
+}
/**
* Unset magic_quotes_runtime - do not change!
*/
diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3
index 687612718..c24215b1b 100644
--- a/libraries/common.lib.php3
+++ b/libraries/common.lib.php3
@@ -34,6 +34,8 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
* the PMA_mysqlDie() function must be before the connection to db but after
* mysql extension has been loaded
*
+ * the PMA_mysqlDie() function needs the PMA_format_sql() Function
+ *
* ... so the required order is:
*
* - parsing of the configuration file
@@ -41,6 +43,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
* MySQL release number)
* - load of mysql extension (if necessary)
* - definition of PMA_sqlAddslashes()
+ * - definition of PMA_format_sql()
* - definition of PMA_mysqlDie()
* - definition of PMA_isInto()
* - definition of PMA_setFontSizes()
@@ -189,6 +192,84 @@ h1 {font-family: sans-serif; font-size: large; font-weight: bold}
return $a_string;
} // end of the 'PMA_sqlAddslashes()' function
+ /**
+ * format sql strings
+ *
+ * @param string sql
+ *
+ * @return string the formatted sql
+ *
+ * @access public
+ *
+ * @author Mike Beck' . "\n" . $query_base . "\n" . '
' . "\n";
+ if($cfg['UseSyntaxColoring']){
+ echo '' . "\n" . PMA_format_sql($query_base) . "\n" . '
' . "\n";
+ } else {
+ echo '' . "\n" . $query_base . "\n" . '
' . "\n";
+ }
echo '