You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/connect/php/pdo-begintransaction.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,13 +35,13 @@ bool PDO::beginTransaction();
35
35
true if the method call succeeded, false otherwise.
36
36
37
37
## Remarks
38
-
The transaction begun with PDO::beginTransaction will end when [PDO::commit](../../connect/php/pdo-commit.md) or [PDO::rollback](../../connect/php/pdo-rollback.md) is called.
38
+
The transaction begun with PDO::beginTransaction ends when [PDO::commit](../../connect/php/pdo-commit.md) or [PDO::rollback](../../connect/php/pdo-rollback.md) is called.
39
39
40
40
PDO::beginTransaction is not affected by (and does not affect) the value of PDO::ATTR_AUTOCOMMIT.
41
41
42
42
You are not allowed to call PDO::beginTransaction before the previous PDO::beginTransaction is ended with PDO::rollback or PDO::commit.
43
43
44
-
The connection will return to auto commit mode if this method fails.
44
+
The connection returns to auto commit mode if this method fails.
45
45
46
46
Support for PDO was added in version 2.0 of the [!INCLUDE[ssDriverPHP](../../includes/ssdriverphp_md.md)].
47
47
@@ -62,6 +62,7 @@ The following example uses a database called Test and a table called Table1. It
*$dsn*: A string that contains the prefix name (always `sqlsrv`), a colon, and the Server keyword. For example `"sqlsrv:server=(local)"`. You can optionally specify other connection keywords. See [Connection Options](../../connect/php/connection-options.md) for a description of the Server keyword and the other connection keywords. The entire *$dsn* is in quotation marks, so each connection keyword should not be individually quoted.
35
+
*$dsn*: A string that contains the prefix name (always `sqlsrv`), a colon, and the Server keyword. For example,`"sqlsrv:server=(local)"`. You can optionally specify other connection keywords. See [Connection Options](../../connect/php/connection-options.md) for a description of the Server keyword and the other connection keywords. The entire *$dsn* is in quotation marks, so each connection keyword should not be individually quoted.
36
36
37
37
*$username*: Optional. A string that contains the user's name. To connect using [!INCLUDE[ssNoVersion](../../includes/ssnoversion_md.md)] Authentication, specify the login ID. To connect using Windows Authentication, specify `""`.
38
38
39
39
*$password*: Optional. A string that contains the user's password. To connect using [!INCLUDE[ssNoVersion](../../includes/ssnoversion_md.md)] Authentication, specify the password. To connect using Windows Authentication, specify `""`.
40
40
41
-
*$driver_options*: Optional. You can specify PDO Driver Manager attributes, and [!INCLUDE[ssDriverPHP](../../includes/ssdriverphp_md.md)] specific driver attributes -- PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ATTR_DIRECT_QUERY. An invalid attribute will not generate an exception. Invalid attributes generate exceptions when specified with [PDO::setAttribute](../../connect/php/pdo-setattribute.md).
41
+
*$driver_options*: Optional. You can specify PDO Driver Manager attributes, and [!INCLUDE[ssDriverPHP](../../includes/ssdriverphp_md.md)] specific driver attributes -- PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ATTR_DIRECT_QUERY. An invalid attribute does not generate an exception. Invalid attributes generate exceptions when specified with [PDO::setAttribute](../../connect/php/pdo-setattribute.md).
42
42
43
43
## Return Value
44
44
Returns a PDO object. If failure, returns a PDOException object.
@@ -49,9 +49,9 @@ PDOException
49
49
## Remarks
50
50
You can close a connection object by setting the instance to null.
51
51
52
-
After a connection, PDO::errorCode will display 01000 instead of 00000.
52
+
After a connection, PDO::errorCode displays 01000 instead of 00000.
53
53
54
-
If PDO::__construct fails for any reason, an exception will be thrown, even if PDO::ATTR_ERRMODE is set to PDO::ERRMODE_SILENT.
54
+
If PDO::__construct fails for any reason, an exception is thrown, even if PDO::ATTR_ERRMODE is set to PDO::ERRMODE_SILENT.
55
55
56
56
Support for PDO was added in version 2.0 of the [!INCLUDE[ssDriverPHP](../../includes/ssdriverphp_md.md)].
57
57
@@ -89,6 +89,7 @@ This example shows how to connect to a server, specifying the database later.
Copy file name to clipboardExpand all lines: docs/connect/php/pdo-errorcode.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,9 +35,9 @@ mixed PDO::errorCode();
35
35
PDO::errorCode returns a five-char SQLSTATE as a string or NULL if there was no operation on the database handle.
36
36
37
37
## Remarks
38
-
PDO::errorCode in the PDO_SQLSRV driver will return warnings on some successful operations. For example, on a successful connection, PDO::errorCode will return "01000" indicating SQL_SUCCESS_WITH_INFO.
38
+
PDO::errorCode in the PDO_SQLSRV driver returns warnings on some successful operations. For example, on a successful connection, PDO::errorCode returns "01000" indicating SQL_SUCCESS_WITH_INFO.
39
39
40
-
PDO::errorCode only retrieves error codes for operations performed directly on the database connection. If you create a PDOStatement instance through PDO::prepare or PDO::query and generate an error on the statement object, PDO::errorCode will not retrieve that error. You must call PDOStatement::errorCode to return the error code for an operation performed on a particular statement object.
40
+
PDO::errorCode only retrieves error codes for operations performed directly on the database connection. If you create a PDOStatement instance through PDO::prepare or PDO::query and an error is generated on the statement object, PDO::errorCode does not retrieve that error. You must call PDOStatement::errorCode to return the error code for an operation performed on a particular statement object.
41
41
42
42
Support for PDO was added in version 2.0 of the [!INCLUDE[ssDriverPHP](../../includes/ssdriverphp_md.md)].
Copy file name to clipboardExpand all lines: docs/connect/php/pdo-errorinfo.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ An array of error information about the most recent operation on the database ha
40
40
41
41
- The driver-specific error message.
42
42
43
-
If there is no error, or if the SQLSTATE is not set, the driver-specific fields will be NULL.
43
+
If there is no error, or if the SQLSTATE is not set, then the driver-specific fields are NULL.
44
44
45
45
## Remarks
46
46
PDO::errorInfo only retrieves error information for operations performed directly on the database. Use PDOStatement::errorInfo when a PDOStatement instance is created using PDO::prepare or PDO::query.
0 commit comments