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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
27 + 33 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 23:01:30 2024 UTC