/PHP-5.5/ext/pdo/ |
H A D | README | 24 $dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => true)); 30 $dbh = new PDO("...", $user, $pass, array(PDO_ATTR_AUTOCOMMIT => false)); 32 When auto-commit is off, you must then use $dbh->beginTransaction() to 33 initiate a transaction. When your work is done, you then call $dbh->commit() 34 or $dbh->rollBack() to persist or abort your changes respectively. Not all 39 $dbh->setAttribute(PDO_ATTR_AUTOCOMMIT, false); 45 $dbh->beginTransaction(). When you commit() or rollBack() such a transaction,
|
H A D | TODO | 48 settable at dbh and stmt levels independently. If set at the dbh level, 50 defaults for the dbh will come from the INI settings.
|
H A D | pdo_dbh.c | 584 stmt->dbh = dbh; in PHP_METHOD() 629 if (dbh->methods->begin(dbh TSRMLS_CC)) { in PHP_METHOD() 1063 dbh->methods->fetch_err(dbh, dbh->query_stmt, return_value TSRMLS_CC); in PHP_METHOD() 1120 stmt->dbh = dbh; in PHP_METHOD() 1297 if (!dbh || !dbh->methods || !dbh->methods->get_driver_methods) { in pdo_hash_methods() 1528 dbh->methods->closer(dbh TSRMLS_CC); in dbh_free() 1556 pefree(dbh, dbh->is_persistent); in dbh_free() 1571 if (dbh->in_txn && dbh->methods && dbh->methods->rollback) { in pdo_dbh_free_storage() 1572 dbh->methods->rollback(dbh TSRMLS_CC); in pdo_dbh_free_storage() 1590 dbh = emalloc(sizeof(*dbh)); in pdo_dbh_new() [all …]
|
H A D | pdo_sql_parser.c | 516 pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC); in pdo_parse_params() 556 pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC); in pdo_parse_params() 559 if (stmt->dbh->methods->quoter) { in pdo_parse_params() 569 if (!stmt->dbh->methods->quoter(stmt->dbh, buf, len, &plc->quoted, &plc->qlen, in pdo_parse_params() 573 strncpy(stmt->error_code, stmt->dbh->error_code, 6); in pdo_parse_params() 611 if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL(tmp_param), in pdo_parse_params() 616 strncpy(stmt->error_code, stmt->dbh->error_code, 6); in pdo_parse_params() 762 if(stmt->dbh->max_escaped_char_length) { 763 padding = stmt->dbh->max_escaped_char_length; 811 if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), [all …]
|
H A D | pdo_sql_parser.re | 158 pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "no parameters were bound" TSRMLS_CC); 198 pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "parameter was not defined" TSRMLS_CC); 201 if (stmt->dbh->methods->quoter) { 211 if (!stmt->dbh->methods->quoter(stmt->dbh, buf, len, &plc->quoted, &plc->qlen, 215 strncpy(stmt->error_code, stmt->dbh->error_code, 6); 253 if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL(tmp_param), 258 strncpy(stmt->error_code, stmt->dbh->error_code, 6); 404 if(stmt->dbh->max_escaped_char_length) { 405 padding = stmt->dbh->max_escaped_char_length; 453 if(stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), [all …]
|
H A D | pdo_stmt.c | 112 if (!stmt->dbh) { \ 217 …if (stmt->dbh->native_case != stmt->dbh->desired_case && stmt->dbh->desired_case != PDO_CASE_NATUR… in pdo_stmt_describe_columns() 220 switch (stmt->dbh->desired_case) { in pdo_stmt_describe_columns() 674 if (stmt->dbh->stringify) { in fetch_value() 1713 if (stmt->dbh->methods->fetch_err) { in PHP_METHOD() 1714 stmt->dbh->methods->fetch_err(stmt->dbh, stmt, return_value TSRMLS_CC); in PHP_METHOD() 1974 if (stmt->dbh->is_persistent) { in pdo_stmt_setup_fetch_mode() 2007 if (stmt->dbh->is_persistent) { in pdo_stmt_setup_fetch_mode() 2276 if (!stmt->dbh) { in dbstmt_method_get() 2282 if (!pdo_hash_methods(stmt->dbh, in dbstmt_method_get() [all …]
|
H A D | php_pdo.h | 78 if (!dbh->driver) { \ 79 pdo_raise_impl_error(dbh, NULL, "00000", "PDO constructor was not called" TSRMLS_CC); \
|
H A D | php_pdo_driver.h | 235 int (*db_handle_factory)(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC); 242 typedef int (*pdo_dbh_close_func)(pdo_dbh_t *dbh TSRMLS_DC); 254 typedef int (*pdo_dbh_txn_func)(pdo_dbh_t *dbh TSRMLS_DC); 257 typedef int (*pdo_dbh_set_attr_func)(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC); 272 typedef int (*pdo_dbh_get_attr_func)(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC); 277 typedef int (*pdo_dbh_check_liveness_func)(pdo_dbh_t *dbh TSRMLS_DC); 282 typedef void (*pdo_dbh_request_shutdown)(pdo_dbh_t *dbh TSRMLS_DC); 574 pdo_dbh_t *dbh; member 655 PDO_API void pdo_raise_impl_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, 658 PDO_API void php_pdo_dbh_addref(pdo_dbh_t *dbh TSRMLS_DC); [all …]
|
H A D | php_pdo_int.h | 58 extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC); 61 strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \ 62 if (dbh->query_stmt) { \ 63 dbh->query_stmt = NULL; \ 64 zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \ 68 #define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NUL… 69 …_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt TSRMLS_CC); } 74 int pdo_hash_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC);
|
/PHP-5.5/ext/pdo/tests/ |
H A D | pdo_026.phpt | 24 public $dbh; 26 protected function __construct($dbh) 28 $this->dbh = $dbh; 70 var_dump(get_class($stmt->dbh));
|
H A D | pdo_029.phpt | 24 public $dbh; 26 protected function __construct($dbh) 28 $this->dbh = $dbh; 78 var_dump(get_class($stmt->dbh));
|
H A D | pdo_030.phpt | 24 public $dbh; 26 protected function __construct($dbh) 28 $this->dbh = $dbh; 79 var_dump(get_class($stmt->dbh));
|
/PHP-5.5/ext/pdo_dblib/ |
H A D | dblib_driver.c | 88 pefree(H, dbh->is_persistent); in dblib_handle_closer() 89 dbh->driver_data = NULL; in dblib_handle_closer() 302 php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars); in pdo_dblib_handle_factory() 304 H = pecalloc(1, sizeof(*H), dbh->is_persistent); in pdo_dblib_handle_factory() 306 H->err.sqlstate = dbh->error_code; in pdo_dblib_handle_factory() 333 if (dbh->username) { in pdo_dblib_handle_factory() 339 if (dbh->password) { in pdo_dblib_handle_factory() 388 dbh->max_escaped_char_length = 2; in pdo_dblib_handle_factory() 389 dbh->alloc_own_columns = 1; in pdo_dblib_handle_factory() 398 dbh->methods = &dblib_methods; in pdo_dblib_handle_factory() [all …]
|
H A D | dblib_stmt.c | 133 …pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbresults() returned FAIL" TSRMLS_CC); in pdo_dblib_stmt_next_rowset() 185 pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "PDO_DBLIB: dbnextrow() returned FAIL" TSRMLS_CC); in pdo_dblib_stmt_fetch()
|
/PHP-5.5/ext/pdo_firebird/ |
H A D | firebird_driver.c | 102 if (dbh->in_txn) { in firebird_handle_closer() 105 RECORD_ERROR(dbh); in firebird_handle_closer() 109 RECORD_ERROR(dbh); in firebird_handle_closer() 115 RECORD_ERROR(dbh); in firebird_handle_closer() 177 RECORD_ERROR(dbh); in firebird_handle_preparer() 204 RECORD_ERROR(dbh); in firebird_handle_preparer() 242 RECORD_ERROR(dbh); in firebird_handle_doer() 249 RECORD_ERROR(dbh); in firebird_handle_doer() 267 RECORD_ERROR(dbh); in firebird_handle_doer() 408 if (dbh->auto_commit && !dbh->in_txn) { in firebird_alloc_prepare_stmt() [all …]
|
H A D | firebird_statement.c | 137 if (stmt->dbh->auto_commit && isc_commit_retaining(H->isc_status, &H->tr)) { in firebird_stmt_execute()
|
H A D | php_pdo_firebird_int.h | 131 void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, long line TSRMLS_DC);
|
/PHP-5.5/ext/pdo_firebird/tests/ |
H A D | bug_47415.phpt | 11 $dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die; 12 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); 14 @$dbh->exec('DROP TABLE testz'); 15 $dbh->exec('CREATE TABLE testz (idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))'); 16 $dbh->exec('INSERT INTO testz VALUES(0, \'String0\')'); 17 $dbh->commit(); 21 $stmt = $dbh->prepare($query); 30 $stmt = $dbh->prepare('DELETE FROM testz'); 33 $dbh->commit(); 35 $dbh->exec('DROP TABLE testz'); [all …]
|
H A D | bug_48877.phpt | 13 @$dbh->exec('DROP TABLE testz'); 14 $dbh->exec('CREATE TABLE testz (A integer)'); 15 $dbh->exec("INSERT INTO testz VALUES ('1')"); 16 $dbh->exec("INSERT INTO testz VALUES ('2')"); 17 $dbh->exec("INSERT INTO testz VALUES ('3')"); 18 $dbh->commit(); 22 $stmt = $dbh->prepare($query); 30 $stmt = $dbh->prepare('DELETE FROM testz'); 33 $dbh->commit(); 35 $dbh->exec('DROP TABLE testz'); [all …]
|
H A D | bug_53280.phpt | 11 $dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die; 13 @$dbh->exec('DROP TABLE testz'); 14 $dbh->exec('CREATE TABLE testz(A VARCHAR(30), B VARCHAR(30), C VARCHAR(30))'); 15 $dbh->exec("INSERT INTO testz VALUES ('A', 'B', 'C')"); 16 $dbh->commit(); 21 $stmth2 = $dbh->prepare($stmt2); 26 $stmth1 = $dbh->prepare($stmt1); 31 $dbh->commit(); 35 $dbh->exec('DROP TABLE testz'); 38 unset($dbh);
|
H A D | bug_62024.phpt | 11 $dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die; 12 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); 14 @$dbh->exec('DROP TABLE test_insert'); 15 $dbh->exec("CREATE TABLE test_insert (ID INTEGER NOT NULL, TEXT VARCHAR(10))"); 17 $dbh->commit(); 22 $sttmt = $dbh->prepare($sql); 33 $dbh->commit(); 37 $sttmt = $dbh->prepare('DELETE FROM test_insert'); 40 $dbh->commit(); 42 $dbh->exec('DROP TABLE test_insert'); [all …]
|
H A D | bug_64037.phpt | 11 $dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die; 12 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); 14 @$dbh->exec('DROP TABLE price'); 16 $dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (1, 'test', -1.0)"); 17 $dbh->exec("INSERT INTO PRICE (ID, TEXT, COST) VALUES (2, 'test', -0.99)"); 20 $dbh->commit(); 23 $stmt = $dbh->prepare($query); 31 $stmt = $dbh->prepare('DELETE FROM price'); 34 $dbh->commit(); 36 $dbh->exec('DROP TABLE price'); [all …]
|
H A D | rowCount.phpt | 13 @$dbh->exec('DROP TABLE testz'); 15 $dbh->exec("INSERT INTO testz VALUES ('A')"); 16 $dbh->exec("INSERT INTO testz VALUES ('A')"); 17 $dbh->exec("INSERT INTO testz VALUES ('B')"); 18 $dbh->commit(); 22 $stmt = $dbh->prepare($query); 32 $dbh->commit(); 34 $stmt = $dbh->prepare('DELETE FROM testz'); 38 $dbh->commit(); 40 $dbh->exec('DROP TABLE testz'); [all …]
|
/PHP-5.5/ext/pdo_mysql/ |
H A D | mysql_driver.c | 85 dbh->is_persistent); in _pdo_mysql_error() 90 dbh->is_persistent); in _pdo_mysql_error() 106 if (!dbh->methods) { in _pdo_mysql_error() 203 pdo_mysql_error(dbh); in mysql_handle_preparer() 219 pdo_mysql_error(dbh); in mysql_handle_preparer() 264 pdo_mysql_error(dbh); in mysql_handle_doer() 269 pdo_mysql_error(dbh); in mysql_handle_doer() 575 php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 5); 586 pdo_mysql_error(dbh); 590 dbh->driver_data = H; [all …]
|
H A D | mysql_statement.c | 59 pefree(S->einfo.errmsg, stmt->dbh->is_persistent); in pdo_mysql_stmt_dtor() 520 pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC); in pdo_mysql_stmt_param_hook()
|