Ado db Thư viện truy xuất CSDL

1 622 2
Ado db Thư viện truy xuất CSDL

Đang tải... (xem toàn văn)

Thông tin tài liệu

Ado db Thư viện truy xuất CSDL

Adodb: Thư viện truy xuất CSDL Adodb: Thư viện truy xuất CSDL, hổ trợ nhiều CSDL Mysql,Oracle,Mssql . Bạn chỉ cần viết code sử dụng gói này, thì sau này chuyển đổi dạng CSDL rất dễ dàng, mà không cần edit code, vì Adodb chứa rất nhiều Driver.Trang chủ: http://adodb.sourceforge.net/Download: http://adodb.sourceforge.net/#download Code mẫuview plainprint? 1. include('/path/to/adodb.inc.php'); 2. $DB = NewADOConnection('mysql'); 3. $DB->Connect($server, $user, $pwd, $db); 4. 5. # M'soft style data retrieval with binds 6. $rs = $DB->Execute("select * from table where key=?",array($key)); 7. while (!$rs->EOF) { 8. print_r($rs->fields); 9. $rs->MoveNext(); 10. } 11. 12. # PEAR style data retrieval 13. $rs = $DB->Execute("select * from table where key=123"); 14. while ($array = $rs->FetchRow()) { 15. print_r($array); 16. } 17. 18. # Alternative URI connection syntax: 19. $DB = NewADOConnection("mysql://$user:$pwd@$server/$db?persist"); 20. 21. # No need for Connect or PConnect when using URI syntax 22. 23. $ok = $DB->Execute("update atable set aval = 0"); 24. if (!$ok) mylogerr($DB->ErrorMsg()); include('/path/to/adodb.inc.php'); $DB = NewADOConnection('mysql'); $DB->Connect($server, $user, $pwd, $db); # M'soft style data retrieval with binds $rs = $DB->Execute("select * from table where key=?",array($key)); while (!$rs->EOF) { print_r($rs->fields); $rs->MoveNext(); } # PEAR style data retrieval $rs = $DB->Execute("select * from table where key=123"); while ($array = $rs->FetchRow()) { print_r($array); } # Alternative URI connection syntax: $DB = NewADOConnection("mysql://$user:$pwd@$server/$db?persist"); # No need for Connect or PConnect when using URI syntax $ok = $DB->Execute("update atable set aval = 0"); if (!$ok) mylogerr($DB->ErrorMsg()); . Adodb: Thư viện truy xuất CSDL Adodb: Thư viện truy xuất CSDL, hổ trợ nhiều CSDL Mysql,Oracle,Mssql... Bạn chỉ cần. đổi dạng CSDL rất dễ dàng, mà không cần edit code, vì Adodb chứa rất nhiều Driver.Trang chủ: http://adodb.sourceforge.net/Download: http://adodb.sourceforge.net/#download

Ngày đăng: 07/09/2012, 09:51

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan