ADOdb: Skirtumas tarp puslapio versijų
Iš PHP, MySQL.
1 eilutė: | 1 eilutė: | ||
− | ADOdb yra duomenų bazių apstrakcijų biblioteka [[PHP]] ir [[Python]] programavimo kalbom. | + | [[Vaizdas:Adodb logo.gif|right]] |
+ | ADOdb yra duomenų bazių apstrakcijų biblioteka [[PHP]] ir [[Python]] programavimo kalbom. Dabartinė PHP ADOdb versija palaiko labai daug duomenų bazių valdymo sistemų: [[MySQL]], [[PostgreSQL]], [[Interbase]], [[Firebird]], [[Informix]], [[Oracle]], [[MsSQL]], [[Foxpro]], [[Access]], [[ADO]], [[Sybase]], [[FrontBase]], [[DB2]], [[SAP DB]], [[SQLite]], [[Netezza]], [[LDAP]], [[ODBC]], [[ODBTP]] ir dar nemažai kitų. | ||
+ | |||
+ | == PHP kodo pavyzdys == | ||
+ | <pre> | ||
+ | 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()); | ||
+ | </pre> | ||
==Nuorodos== | ==Nuorodos== | ||
− | * | + | * http://adodb.sourceforge.net/ - Oficialus ADOdb tinklapis ({{kalba|en}}); |
[[Kategorija:DUK]] | [[Kategorija:DUK]] | ||
[[Kategorija:PHP]] | [[Kategorija:PHP]] | ||
[[Kategorija:Karkasai]] | [[Kategorija:Karkasai]] |
Dabartinė 09:59, 18 Rugsėjo 2008 versija
ADOdb yra duomenų bazių apstrakcijų biblioteka PHP ir Python programavimo kalbom. Dabartinė PHP ADOdb versija palaiko labai daug duomenų bazių valdymo sistemų: MySQL, PostgreSQL, Interbase, Firebird, Informix, Oracle, MsSQL, Foxpro, Access, ADO, Sybase, FrontBase, DB2, SAP DB, SQLite, Netezza, LDAP, ODBC, ODBTP ir dar nemažai kitų.
PHP kodo pavyzdys
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());
Nuorodos
- http://adodb.sourceforge.net/ - Oficialus ADOdb tinklapis ();