Đối tượng dữ liệu PHP
- Giới thiệu
- Installing/Configuring
- Yêu cầu
- Cài đặt
- Cấu hình thời gian chạy
- Loại tài nguyên
- Hằng số được xác định trước
- Kết nối và quản lý kết nối
- Giao dịch và tự động cam kết
- Các báo cáo chuẩn bị và thủ tục lưu trữ
- Lỗi và xử lý lỗi
- Đối tượng lớn [LOB]
- PDO - Lớp PDO
- PDO :: BeginTransaction - bắt đầu một giao dịch
- Pdo :: cam kết - cam kết giao dịch
- PDO :: __ Xây dựng - Tạo một thể hiện PDO đại diện cho kết nối với cơ sở dữ liệu
- PDO :: ErrorCode - Lấy SQLSTATE được liên kết với thao tác cuối cùng trên tay cầm cơ sở dữ liệu
- PDO :: ErrorInfo - Tìm nạp thông tin lỗi mở rộng được liên kết với thao tác cuối cùng trên tay cầm cơ sở dữ liệu
- PDO :: EXEC - Thực hiện câu lệnh SQL và trả về số lượng hàng bị ảnh hưởng
- PDO :: GetAttribution - Truy xuất thuộc tính kết nối cơ sở dữ liệu
- PDO :: GetAvailablesRivers - Trả lại một loạt các trình điều khiển PDO có sẵn
- PDO :: Intransaction - Kiểm tra xem bên trong giao dịch
- PDO :: LastInsertID - Trả về ID của hàng hoặc giá trị chuỗi được chèn cuối cùng
- PDO :: Chuẩn bị - Chuẩn bị một tuyên bố để thực thi và trả về một đối tượng câu lệnh
- PDO :: Truy vấn - Chuẩn bị và thực hiện câu lệnh SQL mà không cần đặt chỗ
- PDO :: Trích dẫn - trích dẫn một chuỗi để sử dụng trong truy vấn
- PDO :: Rollback - Quay lại một giao dịch
- PDO :: SetAttribution - Đặt thuộc tính
- Pdostatement - lớp pdostatement
- Pdostatement :: bindcolumn - liên kết một cột với biến PHP
- PDostatement :: BindParam - liên kết một tham số với tên biến được chỉ định
- Pdostatement :: bindValue - liên kết một giá trị với một tham số
- Pdostatement :: Closecursor - Đóng con trỏ, cho phép câu lệnh được thực thi lại
- Pdostatement :: CộtCount - Trả về số lượng cột trong tập kết quả
- Pdostatement :: DebugDumPparams - Dump một lệnh đã chuẩn bị SQL
- Pdostatement :: ErrorCode - tìm nạp sqlstate được liên kết với thao tác cuối cùng trên tay cầm câu lệnh
- Pdostatement :: ErrorInfo - Tìm nạp thông tin lỗi mở rộng được liên kết với thao tác cuối cùng trên tay cầm câu lệnh
- Pdostatement :: thực thi - thực hiện một tuyên bố đã chuẩn bị
- Pdostatement :: tìm nạp - tìm nạp hàng tiếp theo từ một tập kết quả
- Pdostatement :: fetchall - lấy các hàng còn lại từ một tập hợp kết quả
- Pdostatement :: fetchcolumn - trả về một cột duy nhất từ hàng tiếp theo của bộ kết quả
- Pdostatement :: fetchobject - tìm nạp hàng tiếp theo và trả về nó dưới dạng đối tượng
- Pdostatement :: getAttribution - Truy xuất thuộc tính câu lệnh
- Pdostatement :: GetColumnMeta - Trả về siêu dữ liệu cho một cột trong một tập hợp kết quả
- Pdostatement :: getIterator - Nhận kết quả đặt iterator
- Pdostatement :: nextrowset-tiến tới Rowset tiếp theo trong một tay cầm câu lệnh nhiều hàng
- Pdostatement :: RowCount - Trả về số lượng hàng bị ảnh hưởng bởi câu lệnh SQL cuối cùng
- PDostatement :: SetAttribution - Đặt thuộc tính câu lệnh
- Pdostatement :: setfetchmode - Đặt chế độ tìm nạp mặc định cho câu lệnh này
- PDOException - Lớp PDOException
- Trình điều khiển PDO
- Cubrid [PDO] - Hàm Cubrid [PDO_Cubrid]
- MS SQL Server [PDO] - Chức năng Microsoft SQL Server và Sybase [PDO_DBLIB]
- FIREBIRD [PDO] - Chức năng của Firebird [PDO_FireBird]
- IBM [PDO] - Hàm IBM [PDO_IBM]
- Informix [PDO] - Chức năng Informix [PDO_informix]
- MySQL [PDO] - Hàm MySQL [PDO_MYSQL]
- MS SQL Server [PDO] - Chức năng Microsoft SQL Server [PDO_SQLSRV]
- Oracle [PDO] - Các chức năng của Oracle [PDO_oci]
- ODBC và DB2 [PDO] - Các hàm ODBC và DB2 [PDO_ODBC]
- PostgreSQL [PDO] - Hàm PostgreSQL [PDO_PGSQL]
- SQLite [PDO] - Hàm SQLite [PDO_SQLite]
djlopez tại gmx dot de ¶ ¶
16 năm trước
Please note this:
Won't work:
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
THIS WORKS!
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
The parameter cannot be applied on table names!!
Wiserufferto tại Gmail Dot Com ¶ ¶
1 năm trước
This is a little late... but I'm old and slow.......
Regarding Extending PDOStatement and PDO I found that sending the PDOExtended class by reference helps:
In the constructor after parent::__construct[] :
$this->setAttribute[\PDO::ATTR_STATEMENT_CLASS,array['PDOStatementExtended', [&$this]]];}
And in
class PDOStatementExtended extends \PDOStatement
{
protected function __construct
[
\PDO &$PDO,
]
Pokojny tại Radlight Dot Com ¶ ¶
16 năm trước
I wanted to extend PDO class to store statistics of DB usage, and I faced some problems. I wanted to count number of created statements and number of their executings. So PDOStatement should have link to PDO that created it and stores the statistical info. The problem was that I didn't knew how PDO creates PDOStatement [constructor parameters and so on], so I have created these two classes:
Won't work:
0
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
Won't work:
1
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
Won't work:
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
2Wiserufferto tại Gmail Dot Com ¶ ¶
1 năm trước
Won't work:
3
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
Pokojny tại Radlight Dot Com ¶ ¶
1 năm trước
Won't work:
4
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
Won't work:
5
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
Won't work:
6
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
Bart tại MediaWave Dot NL ¶ ¶
15 năm trước
Won't work:
8
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
Won't work:
9
$sth = $dbh->prepare['SELECT name, colour, calories FROM ? WHERE calories < ?'];
THIS WORKS!
0
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
THIS WORKS!
1
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
Anton Dot Clarke tại Sonikmedia Dot Com ¶ ¶
16 năm trước
THIS WORKS!
3
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
THIS WORKS!
4
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
THIS WORKS!
5
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
THIS WORKS!
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
6Wiserufferto tại Gmail Dot Com ¶ ¶
1 năm trước
THIS WORKS!
7
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
THIS WORKS!
8
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
THIS WORKS!
9
$sth = $dbh->prepare['SELECT name, colour, calories FROM fruit WHERE calories < ?'];
The parameter cannot be applied on table names!!
0
The parameter cannot be applied on table names!!
1Pokojny tại Radlight Dot Com ¶ ¶
Bart tại MediaWave Dot NL ¶
The parameter cannot be applied on table names!!
2
15 năm trước ¶
16 năm trước
The parameter cannot be applied on table names!!
3
The parameter cannot be applied on table names!!
4
The parameter cannot be applied on table names!!
5
Wiserufferto tại Gmail Dot Com ¶ ¶
16 năm trước
The parameter cannot be applied on table names!!
7
Wiserufferto tại Gmail Dot Com ¶ ¶
1 năm trước
The parameter cannot be applied on table names!!
8
The parameter cannot be applied on table names!!
9
0
1
2Pokojny tại Radlight Dot Com ¶ ¶
Bart tại MediaWave Dot NL ¶
3
4
15 năm trước ¶
1 năm trước
6
7
8
Pokojny tại Radlight Dot Com ¶ ¶
16 năm trước
This is a little late... but I'm old and slow.......
0
Regarding Extending PDOStatement and PDO I found that sending the PDOExtended class by reference helps:
In the constructor after parent::__construct[] :
$this->setAttribute[\PDO::ATTR_STATEMENT_CLASS,array['PDOStatementExtended', [&$this]]];}
This is a little late... but I'm old and slow.......
1
Regarding Extending PDOStatement and PDO I found that sending the PDOExtended class by reference helps:
In the constructor after parent::__construct[] :
$this->setAttribute[\PDO::ATTR_STATEMENT_CLASS,array['PDOStatementExtended', [&$this]]];}
This is a little late... but I'm old and slow.......
2
Regarding Extending PDOStatement and PDO I found that sending the PDOExtended class by reference helps:
In the constructor after parent::__construct[] :
$this->setAttribute[\PDO::ATTR_STATEMENT_CLASS,array['PDOStatementExtended', [&$this]]];}