note 85919 added to pdo.query
| From: | marcos at marcosregis dot com | Date: | Wed, 24 Sep 2008 16:14:18 +0000 |
| Subject: | note 85919 added to pdo.query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144676@lists.php.net to get a copy of this message | ||
After a lot of hours working with DataLink on Oracle->MySQL and PDO we (me and Adriano Rodrigues,
that solve it) discover that PDO (and oci too) need the attribute AUTOCOMMIT set to FALSE to work
correctly with.
There's 3 ways to set autocommit to false: On constructor, setting the atribute after
construct and before query data or initiating a Transaction (that turns off autocommit mode)
The examples:
<?php
// First way - On PDO Constructor
$options = array(PDO::ATTR_AUTOCOMMIT=>FALSE);
$pdo = new PDO($dsn,$user,$pass,$options);
// now we are ready to query DataLinks
?>
<?php
// Second Way - Before create statements
$pdo = new PDO($dsn,$user,$pass);
$pdo->setAttribute(PDO::ATTR_AUTOCOMMIT,FALSE);
// or
$pdo->beginTransaction();
// now we are ready to query DataLinks
?>
To use DataLinks on oci just use OCI_DEFAULT on oci_execute() function;
----
Server IP: 200.185.109.13
Probable Submitter: 200.204.154.71
----
Manual Page -- http://www.php.net/manual/en/pdo.query.php
Edit -- https://master.php.net/note/edit/85919
Del: integrated -- https://master.php.net/note/delete/85919/integrated
Del: useless -- https://master.php.net/note/delete/85919/useless
Del: bad code -- https://master.php.net/note/delete/85919/bad+code
Del: spam -- https://master.php.net/note/delete/85919/spam
Del: non-english -- https://master.php.net/note/delete/85919/non-english
Del: in docs -- https://master.php.net/note/delete/85919/in+docs
Del: other reasons-- https://master.php.net/note/delete/85919
Reject -- https://master.php.net/note/reject/85919
Search -- https://master.php.net/manage/user-notes.php