diff --git a/WordPress/Docs/DB/PreparedSQLStandard.xml b/WordPress/Docs/DB/PreparedSQLStandard.xml new file mode 100644 index 0000000000..d4c63db285 --- /dev/null +++ b/WordPress/Docs/DB/PreparedSQLStandard.xml @@ -0,0 +1,50 @@ + + + + prepare(), and use placeholders for all variables used in the query. You should not use variable interpolation or concatenation. + ]]> + + + + prepare( + "SELECT * from table WHERE field = %s", + $val +); + ]]> + + + prepare( + "SELECT * from table WHERE field = {$val}" +); + ]]> + + + + + + prepare( + "SELECT * from table WHERE field = %s", + $val +); + ]]> + + + prepare( + "SELECT * from table WHERE field = " . $val +); + ]]> + + +