php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62503 DDL statements in PDO queries are implicitly commited!
Submitted: 2012-07-07 20:56 UTC Modified: 2012-07-20 06:21 UTC
From: kotai dot kristof at gmail dot com Assigned: aharvey (profile)
Status: Closed Package: PDO related
PHP Version: Irrelevant OS: Win
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kotai dot kristof at gmail dot com
New email:
PHP Version: OS:

 

 [2012-07-07 20:56 UTC] kotai dot kristof at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/pdo.commit#refsect1-pdo.commit-examples
---

In the manual on this page: http://www.php.net/manual/en/pdo.commit.php

In the first example, the code is very misleading. Because DDL statements in PDO 
queries are always implicitly commited! So the commit() call after the exec() call  
makes no difference. 

Instead use an INSERT, UPDATE or DELETE query pls.

Test script:
---------------
not required


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-08 16:51 UTC] felipe@php.net
-Type: Bug +Type: Documentation Problem
 [2012-07-08 21:06 UTC] johannes@php.net
Note: Some DBMSs allow DDL in transactions. But yes, a better example woud be good. btw. if you want that to happen faster: go to https://edit.php.net/?project=PHP&perm=en/pdo.commit.php and propose an better example!
 [2012-07-20 06:20 UTC] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=326723
Log: Fix doc bug #62503 (DDL statements in PDO queries are implicitly commited!).
 [2012-07-20 06:21 UTC] aharvey@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-07-20 06:21 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Dec 04 02:03:36 2021 UTC