diff options
-rw-r--r-- | index.html | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -16,6 +16,9 @@ padding-top: 20px; padding-bottom: 40px; } + pre { + color: white; + } </style> <link href="css/bootstrap-responsive.min.css" rel="stylesheet"> @@ -149,6 +152,28 @@ echo SqlFormatter::highlight($sql);</pre> <hr> + <section> + <h3>Compress SQL Query</h3> + + <p>The compress method compresses whitespace and removes comments.</p> + + <pre class='prettyprint lang-php'><?php +$sql = "-- This is a comment +SELECT +/* This is another comment +On more than one line */ +Id #This is one final comment +as temp, DateCreated as Created FROM MyTable;"; + +echo SqlFormatter::compress($sql);</pre> + + <pre style="color: black; background-color: white;"> +SELECT Id as temp, DateCreated as Created FROM MyTable;</pre> + + </section> + + <hr> + <section> <h3>Remove SQL Comments</h3> |