mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
a reminder for us all :)
git-svn-id: file:///svn/phpbb/trunk@7796 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
b3c1501e26
commit
a3fd064b8a
1 changed files with 17 additions and 0 deletions
|
@ -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 "not equals operator", as defined by the SQL:2003 standard, is "<>"</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>
|
||||
|
|
Loading…
Add table
Reference in a new issue