summaryrefslogtreecommitdiffstats
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/index.html b/index.html
index ecc1568..3d82030 100644
--- a/index.html
+++ b/index.html
@@ -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'>&lt;?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>