ADOdb是一个PHP编程语言用来访问数据库的抽象接口。
示例代码:
include('/path/to/adodb.inc.php');$DB=NewADOConnection('mysql');$DB->Connect($server,$user,$pwd,$db);#M'softstyledataretrievalwithbinds$rs=$DB->Execute("select*fromtablewherekey=?",array($key));while(!$rs->EOF){print_r($rs->fields);$rs->MoveNext();}#PEARstyledataretrieval$rs=$DB->Execute("select*fromtablewherekey=123");while($array=$rs->FetchRow()){print_r($array);}#AlternativeURIconnectionsyntax:$DB=NewADOConnection("mysql://$user:$pwd@$server/$db?persist");#NoneedforConnectorPConnectwhenusingURIsyntax$ok=$DB->Execute("updateatablesetaval=0");if(!$ok)mylogerr($DB->ErrorMsg());
评论