|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Submitted: 2013-04-03 00:09 UTC Modified: 2013-04-06 15:43 UTC
From: jehoshua02 at gmail dot com Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.4.13 OS: Ubuntu 12.10 Desktop 64bit
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.
Block user comment
Status: Assign to:
Bug Type:
From: jehoshua02 at gmail dot com
New email:
PHP Version: OS:


 [2013-04-03 00:09 UTC] jehoshua02 at gmail dot com
I'm using PDO in some simple script to do database migrations and realized that my triggers weren't being created. I checked to make sure the triggers were correct by first copying and pasting them into mysql interactive console, then by using `SOURCE ...`, then by passing the file name into mysql command, each time verifying the trigger was created by using "SHOW TRIGGERS WHERE `Trigger` = :trigger". I concluded that the problem was not with my trigger statements, or with mysql, but with PDO.

The actual PHP version is 5.4.6-1ubuntu1.2 so I chose the closest one.

Test script:

Expected result:
I would expect to see the trigger printed as an associative array.

Actual result:
The trigger is not created even though the script completes without any errors or exceptions.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-03 00:28 UTC] jehoshua02 at gmail dot com
Could the root of this problem be somehow related to the multiple-query problem?
 [2013-04-06 15:43 UTC]
DELIMITER is not a mysql statement, but a mysql client command.

Use a separated statement for create trigger part. e.g. $pdo->query("CREATE TRIGGER ...");
 [2013-04-06 15:43 UTC]
-Status: Open +Status: Not a bug
 [2013-08-26 22:24 UTC] email at philsturgeon dot co dot uk
This should actually be $pdo->exec('CREATE TRIGGER...');
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 08:01:31 2024 UTC