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 *

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.

+

Avoid DB specific SQL:

+

The "not equals operator", as defined by the SQL:2003 standard, is "<>"

+ +

// This is wrong.

+
+$sql = 'SELECT * 
+	FROM ' . SOME_TABLE . ' 
+	WHERE a != 2';
+	
+ +

// This is right.

+
+$sql = 'SELECT * 
+	FROM ' . SOME_TABLE . ' 
+	WHERE a <> 2';
+	
+

Common DBAL methods:

sql_escape():