Skip to content

Commit c5ab152

Browse files
authored
Merge pull request #2387 from v-kaywon/patch-2
Update pdo-prepare.md
2 parents 9f6d58c + 8f71280 commit c5ab152

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

docs/connect/php/pdo-prepare.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
---
2-
title: "PDO::prepare | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "01/19/2017"
5-
ms.prod: "sql-non-specified"
6-
ms.reviewer: ""
7-
ms.suite: ""
8-
ms.technology:
9-
- "drivers"
10-
ms.tgt_pltfrm: ""
11-
ms.topic: "article"
12-
ms.assetid: a8b16fdc-c748-49be-acf2-a6ac7432d16b
13-
caps.latest.revision: 28
14-
author: "MightyPen"
15-
ms.author: "genemi"
16-
manager: "jhubbard"
17-
---
18-
# PDO::prepare
19-
[!INCLUDE[Driver_PHP_Download](../../includes/driver_php_download.md)]
20-
1+
---
2+
title: "PDO::prepare | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "07/10/2017"
5+
ms.prod: "sql-non-specified"
6+
ms.reviewer: ""
7+
ms.suite: ""
8+
ms.technology:
9+
- "drivers"
10+
ms.tgt_pltfrm: ""
11+
ms.topic: "article"
12+
ms.assetid: a8b16fdc-c748-49be-acf2-a6ac7432d16b
13+
caps.latest.revision: 28
14+
author: "MightyPen"
15+
ms.author: "genemi"
16+
manager: "jhubbard"
17+
---
18+
# PDO::prepare
19+
[!INCLUDE[Driver_PHP_Download](../../includes/driver_php_download.md)]
20+
2121
Prepares a statement for execution.
2222

2323
## Syntax
@@ -43,7 +43,7 @@ The following table lists the possible *key_pair* values.
4343
|Key|Description|
4444
|-------|---------------|
4545
|PDO::ATTR_CURSOR|Specifies cursor behavior. The default is PDO::CURSOR_FWDONLY. PDO::CURSOR_SCROLL is a static cursor.<br /><br />For example, `array( PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY )`.<br /><br />If you use PDO::CURSOR_SCROLL, you can use PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE, which is described below.<br /><br />See [Cursor Types &#40;PDO_SQLSRV Driver&#41;](../../connect/php/cursor-types-pdo-sqlsrv-driver.md) for more information about result sets and cursors in the PDO_SQLSRV driver.|
46-
|PDO::ATTR_EMULATE_PREPARES|The purpose of PDO::ATTR_EMULATE_PREPARES is described in the [PHP manual](http://us3.php.net/pdo).<br /><br />[!INCLUDE[ssNoVersion](../../includes/ssnoversion_md.md)] does not support named or positional parameters in some [!INCLUDE[tsql](../../includes/tsql_md.md)] clauses.<br /><br />If your PHP application must use parameters in a [!INCLUDE[tsql](../../includes/tsql_md.md)] clause that will generate an error on the server, you can set the PDO::ATTR_EMULATE_PREPARES attribute to true. For example:<br /><br />`PDO::ATTR_EMULATE_PREPARES => true`<br /><br />By default, this attribute is set to false.<br /><br />**Note:** The security of parameterized queries is not in effect when you use `PDO::ATTR_EMULATE_PREPARES => true`. Your application should ensure that the data that is bound to the parameter(s) does not contain malicious [!INCLUDE[tsql](../../includes/tsql_md.md)] code.|
46+
|PDO::ATTR_EMULATE_PREPARES|When PDO::ATTR_EMULATE_PREPARES is on, the placeholders in a prepared statement is replaced by bound parameters. A complete SQL statement with no placeholders is then sent to the database at Execute. <br /><br />PDO::ATTR_EMULATE_PREPARES can be used to bypass some restrictions in SQL Server. For example, SQL Server does not support named or positional parameters in some Transact-SQL clauses. Also, SQL Server has a limit of binding 2100 parameters.<br /><br />You can set the PDO::ATTR_EMULATE_PREPARES attribute to true. For example:<br /><br />`PDO::ATTR_EMULATE_PREPARES => true`<br /><br />By default, this attribute is set to false.<br /><br />**Note:** The security of parameterized queries is not in effect when you use `PDO::ATTR_EMULATE_PREPARES => true`. Your application should ensure that the data that is bound to the parameter(s) does not contain malicious Transact-SQL code.<br /><br />**Limitations:**: Because the parameters are not bound using the database's parameterized query feature, input_output and output parameters are not supported.|
4747
|PDO::SQLSRV_ATTR_ENCODING|PDO::SQLSRV_ENCODING_UTF8 (default)<br /><br />PDO::SQLSRV_ENCODING_SYSTEM<br /><br />PDO::SQLSRV_ENCODING_BINARY|
4848
|PDO::SQLSRV_ATTR_DIRECT_QUERY|When True, specifies direct query execution. False means prepared statement execution. For more information about PDO::SQLSRV_ATTR_DIRECT_QUERY, see [Direct Statement Execution and Prepared Statement Execution in the PDO_SQLSRV Driver](../../connect/php/direct-statement-execution-prepared-statement-execution-pdo-sqlsrv-driver.md).|
4949
|PDO::SQLSRV_ATTR_QUERY_TIMEOUT|For more information, see [PDO::setAttribute](../../connect/php/pdo-setattribute.md).|

0 commit comments

Comments
 (0)