aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/docs/coding-guidelines.html
diff options
context:
space:
mode:
authorDavid M <davidmj@users.sourceforge.net>2007-06-25 15:28:47 +0000
committerDavid M <davidmj@users.sourceforge.net>2007-06-25 15:28:47 +0000
commita3fd064b8a3754c906d2710121500962fef2f557 (patch)
treee6256ab3ea58a5f4170145d16c8485266a956453 /phpBB/docs/coding-guidelines.html
parentb3c1501e269421540f0f177b011d99415c774aec (diff)
downloadforums-a3fd064b8a3754c906d2710121500962fef2f557.tar
forums-a3fd064b8a3754c906d2710121500962fef2f557.tar.gz
forums-a3fd064b8a3754c906d2710121500962fef2f557.tar.bz2
forums-a3fd064b8a3754c906d2710121500962fef2f557.tar.xz
forums-a3fd064b8a3754c906d2710121500962fef2f557.zip
a reminder for us all :)
git-svn-id: file:///svn/phpbb/trunk@7796 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/docs/coding-guidelines.html')
-rw-r--r--phpBB/docs/coding-guidelines.html17
1 files changed, 17 insertions, 0 deletions
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 5dd70928fd..8fd904e7c0 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -780,6 +780,23 @@ $sql = 'SELECT *
<p>In other words use single quotes where no variable substitution is required or where the variable involved shouldn't appear within double quotes. Otherwise use double quotes.</p>
+ <h3>Avoid DB specific SQL: </h3>
+ <p>The &quot;not equals operator&quot;, as defined by the SQL:2003 standard, is &quot;&lt;&gt;&quot;</p>
+
+ <p class="bad">// This is wrong.</p>
+ <blockquote><pre>
+$sql = 'SELECT *
+ FROM ' . SOME_TABLE . '
+ WHERE a != 2';
+ </pre></blockquote>
+
+ <p class="good">// This is right. </p>
+ <blockquote><pre>
+$sql = 'SELECT *
+ FROM ' . SOME_TABLE . '
+ WHERE a <> 2';
+ </pre></blockquote>
+
<h3>Common DBAL methods: </h3>
<h3>sql_escape():</h3>