本文整理汇总了PHP中db_connect::db方法的典型用法代码示例。如果您正苦于以下问题:PHP db_connect::db方法的具体用法?PHP db_connect::db怎么用?PHP db_connect::db使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db_connect
的用法示例。
在下文中一共展示了db_connect::db方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OPM
public function OPM($query)
{
# query the users table for name and surname
$sqlop = new db_connect();
#truncate current table before reloading
$sqlop->db('truncate table DI_test_records');
#insert the records into current table
$sqlop->db('insert into DI_test_records select * FROM DI_test_records_v');
$result = $sqlop->db('SELECT * FROM DI_test_records where rownum<2');
# perform the query
#$result = odbc_exec($connect, $query);
$xml = new DOMDocument("1.0", "utf-8");
$xml->formatOutput = true;
#$root = $xml->createElementNS('http://www.cancerresearchuk.org/di/r17/supplier/newdonate');
$gen = $xml->createElementNS("http://www.cancerresearchuk.org/di/r19/supplier/openmarket", "batch");
$xml->appendChild($gen);
$id = $xml->createElement("id", date('YmdHis'));
$gen->appendChild($id);
$ltran = $xml->createElement("listOfTransaction");
$gen->appendChild($ltran);
$tran = $xml->createElement("transaction");
$ltran->appendChild($tran);
while ($row = odbc_fetch_row($result)) {
$Trefe = $xml->createElement("externalTransactionId", date('YmdHis'));
$tran->appendChild($Trefe);
$supporter = $xml->createElement("supporter");
$tran->appendChild($supporter);
$pExtRef = $xml->createElement("primaryExternalReferenceId", odbc_result($result, "SUPP_primaryExternalRefId"));
$supporter->appendChild($pExtRef);
$PDataSo = $xml->createElement("primaryDataSourceCode", odbc_result($result, "SUPP_primaryDataSourceCode"));
$supporter->appendChild($PDataSo);
$fore = $xml->createElement("forename", odbc_result($result, "SUPP_forename"));
$supporter->appendChild($fore);
$SSdate = $xml->createElement("startDate", odbc_result($result, "SUPP_startDate"));
$supporter->appendChild($SSdate);
$SSource = $xml->createElement("source", odbc_result($result, "SUPP_source"));
$supporter->appendChild($SSource);
$SStatus = $xml->createElement("statusCode", odbc_result($result, "SUPP_statusCode"));
$supporter->appendChild($SStatus);
$SuppURN = $xml->createElement("supporterURN", odbc_result($result, "SUPP_supporterURN"));
$supporter->appendChild($SuppURN);
$surname = $xml->createElement("surname", odbc_result($result, "SUPP_surname"));
$supporter->appendChild($surname);
$lsdFlag = $xml->createElement("lsdFlag", odbc_result($result, "SUPP_lsdFlag"));
$supporter->appendChild($lsdFlag);
$lsdIdentifier = $xml->createElement("lsdIdentifier", odbc_result($result, "SUPP_lsdIdentifier"));
$supporter->appendChild($lsdIdentifier);
$lsdType = $xml->createElement("lsdType", odbc_result($result, "SUPP_lsdType"));
$supporter->appendChild($lsdType);
#Contact Info
$contactInfoM = $xml->createElement("contactInfo-Mobile");
$supporter->appendChild($contactInfoM);
$mobileNumber = $xml->createElement("mobileNumber", odbc_result($result, "CONINFO_mobileNumber"));
$contactInfoM->appendChild($mobileNumber);
#Payments
$listOfDonations = $xml->createElement("listOfDonations");
$supporter->appendChild($listOfDonations);
$donations = $xml->createElement("donations");
$listOfDonations->appendChild($donations);
$amount = $xml->createElement("amount", odbc_result($result, "Don_amount"));
$donations->appendChild($amount);
$bankAccountCode = $xml->createElement("bankAccountCode-CRUK", odbc_result($result, "Don_bankAccountCodeCRUK"));
$donations->appendChild($bankAccountCode);
$DdataSource = $xml->createElement("dataSource", odbc_result($result, "Don_dataSource"));
$donations->appendChild($DdataSource);
$dateReceived = $xml->createElement("dateReceived", odbc_result($result, "Don_dateReceived") . "T13:11:20");
$donations->appendChild($dateReceived);
$donationType = $xml->createElement("donationType", odbc_result($result, "Don_donationType"));
$donations->appendChild($donationType);
$financialPaymentReference = $xml->createElement("financialPaymentReference", odbc_result($result, "Don_financialPaymentReference"));
$donations->appendChild($financialPaymentReference);
$paymentMethod = $xml->createElement("paymentMethod", odbc_result($result, "Don_paymentMethod"));
$donations->appendChild($paymentMethod);
$paymentStatus = $xml->createElement("paymentStatus", odbc_result($result, "Don_paymentStatus"));
$donations->appendChild($paymentStatus);
$Dproduct = $xml->createElement("product", odbc_result($result, "Don_product"));
$donations->appendChild($Dproduct);
$Dsource = $xml->createElement("source", odbc_result($result, "Don_source"));
$donations->appendChild($Dsource);
$originatorPaymentID = $xml->createElement("originatorPaymentID", odbc_result($result, "Don_originatorPaymentID"));
$donations->appendChild($originatorPaymentID);
$shortCode = $xml->createElement("shortCode", odbc_result($result, "Don_shortCode"));
$donations->appendChild($shortCode);
$statusDelay = $xml->createElement("statusDelay", odbc_result($result, "Don_statusDelay"));
$donations->appendChild($statusDelay);
$statusDelayUnit = $xml->createElement("statusDelayUnit", odbc_result($result, "Don_statusDelayUnit"));
$donations->appendChild($statusDelayUnit);
$mobileOperator = $xml->createElement("mobileOperator", odbc_result($result, "Don_mobileOperator"));
$donations->appendChild($mobileOperator);
$keyword = $xml->createElement("keyword", odbc_result($result, "Don_keyword"));
$donations->appendChild($keyword);
#Suppressions
$listOfSuppressionsPreferences = $xml->createElement("listOfSuppressionsPreferences");
$supporter->appendChild($listOfSuppressionsPreferences);
$suppressionsPreferences = $xml->createElement("suppressionsPreferences");
$listOfSuppressionsPreferences->appendChild($suppressionsPreferences);
$SstartDate = $xml->createElement("startDate", odbc_result($result, "SuppPre_startDate"));
$suppressionsPreferences->appendChild($SstartDate);
$suppressionPreferenceCode = $xml->createElement("suppressionPreferenceCode", odbc_result($result, "SuppPre_suppressionPreCode"));
$suppressionsPreferences->appendChild($suppressionPreferenceCode);
//.........这里部分代码省略.........
示例2: ND
public function ND($query)
{
# query the users table for name and surname
$sqlop = new db_connect();
#truncate current table before reloading
$sqlop->db('truncate table DI_test_records');
#insert the records into current table
$sqlop->db('insert into DI_test_records select * FROM DI_test_records_v');
$result = $sqlop->db('SELECT * FROM DI_test_records where rownum<2');
# perform the query
#$result = odbc_exec($connect, $query);
$xml = new DOMDocument("1.0", "utf-8");
$xml->formatOutput = true;
$gen = $xml->createElementNS("http://www.cancerresearchuk.org/di/r17/supplier/newdonate", "transaction");
$xml->appendChild($gen);
$Trefe = $xml->createElement("reference", "testval");
$gen->appendChild($Trefe);
while ($row = odbc_fetch_row($result)) {
$supporter = $xml->createElement("supporter");
$gen->appendChild($supporter);
$pExtRef = $xml->createElement("primaryExternalReferenceId", odbc_result($result, "SUPP_primaryExternalRefId"));
$supporter->appendChild($pExtRef);
$PDataSo = $xml->createElement("primaryDataSourceCode", odbc_result($result, "SUPP_primaryDataSourceCode"));
$supporter->appendChild($PDataSo);
$fore = $xml->createElement("forename", odbc_result($result, "SUPP_forename"));
$supporter->appendChild($fore);
$SSdate = $xml->createElement("startDate", odbc_result($result, "SUPP_startDate"));
$supporter->appendChild($SSdate);
$SSource = $xml->createElement("source", odbc_result($result, "SUPP_source"));
$supporter->appendChild($SSource);
$SStatus = $xml->createElement("statusCode", odbc_result($result, "SUPP_statusCode"));
$supporter->appendChild($SStatus);
$SStDate = $xml->createElement("statusDate", odbc_result($result, "SUPP_statusDate"));
$supporter->appendChild($SStDate);
$surname = $xml->createElement("surname", odbc_result($result, "SUPP_surname"));
$supporter->appendChild($surname);
$Title = $xml->createElement("title", odbc_result($result, "SUPP_title"));
$supporter->appendChild($Title);
#Address
$address = $xml->createElement("address");
$supporter->appendChild($address);
$addressLine1 = $xml->createElement("addressLine1", odbc_result($result, "ADDR_addressLine1"));
$address->appendChild($addressLine1);
$addressLine2 = $xml->createElement("addressLine2", odbc_result($result, "ADDR_addressLine2"));
$address->appendChild($addressLine2);
$addressLine3 = $xml->createElement("addressLine3", odbc_result($result, "ADDR_addressLine3"));
$address->appendChild($addressLine3);
$addressLine4 = $xml->createElement("addressLine4", odbc_result($result, "ADDR_addressLine4"));
$address->appendChild($addressLine4);
$city = $xml->createElement("city", odbc_result($result, "ADDR_city"));
$address->appendChild($city);
$country = $xml->createElement("country", odbc_result($result, "ADDR_country"));
$address->appendChild($country);
$county = $xml->createElement("county", odbc_result($result, "ADDR_county"));
$address->appendChild($county);
$postalCode = $xml->createElement("postalCode", odbc_result($result, "ADDR_postalCode"));
$address->appendChild($postalCode);
$startDate = $xml->createElement("startDate", odbc_result($result, "ADDR_startDate"));
$address->appendChild($startDate);
$validationStatus = $xml->createElement("validationStatus", odbc_result($result, "ADDR_validationStatus"));
$address->appendChild($validationStatus);
#Contact Info
$contactInfoP = $xml->createElement("contactInfo-Phone");
$supporter->appendChild($contactInfoP);
$phoneNumber = $xml->createElement("phoneNumber", odbc_result($result, "CONINFO_phoneNumber"));
$contactInfoP->appendChild($phoneNumber);
$contactInfoE = $xml->createElement("contactInfo-Email");
$supporter->appendChild($contactInfoE);
$emailAddress = $xml->createElement("emailAddress", odbc_result($result, "CONINFO_emailAddress"));
$contactInfoE->appendChild($emailAddress);
$contactInfoM = $xml->createElement("contactInfo-Mobile");
$supporter->appendChild($contactInfoM);
$mobileNumber = $xml->createElement("mobileNumber", odbc_result($result, "CONINFO_mobileNumber"));
$contactInfoM->appendChild($mobileNumber);
#GAD
$giftAidDeclaration = $xml->createElement("giftAidDeclaration");
$supporter->appendChild($giftAidDeclaration);
$confirmedOn = $xml->createElement("confirmedOn", odbc_result($result, "GAD_confirmedOn"));
$giftAidDeclaration->appendChild($confirmedOn);
$declarationDate = $xml->createElement("declarationDate", odbc_result($result, "GAD_declarationDate"));
$giftAidDeclaration->appendChild($declarationDate);
$letterCode = $xml->createElement("letterCode", odbc_result($result, "GAD_letterCode"));
$giftAidDeclaration->appendChild($letterCode);
$method = $xml->createElement("method", odbc_result($result, "GAD_method"));
$giftAidDeclaration->appendChild($method);
$greference = $xml->createElement("reference", odbc_result($result, "GAD_reference"));
$giftAidDeclaration->appendChild($greference);
$gsource = $xml->createElement("source", odbc_result($result, "GAD_source"));
$giftAidDeclaration->appendChild($gsource);
$gadType = $xml->createElement("gadType", odbc_result($result, "GAD_gadType"));
$giftAidDeclaration->appendChild($gadType);
#DD
$directDebit = $xml->createElement("directDebit");
$supporter->appendChild($directDebit);
$accountName = $xml->createElement("accountName", odbc_result($result, "DD_accountName"));
$directDebit->appendChild($accountName);
$amount = $xml->createElement("amount", odbc_result($result, "DD_amount"));
$directDebit->appendChild($amount);
$bankAccountNumber = $xml->createElement("bankAccountNumber", odbc_result($result, "DD_bankAccountNumber"));
$directDebit->appendChild($bankAccountNumber);
//.........这里部分代码省略.........
示例3: DOMDocument
<?php
include 'index.php';
include 'db_connect.php';
$connect = odbc_connect("SIT", "palagi01", "s1mple01");
# query the users table for name and surname
$sqlop = new db_connect();
$result = $sqlop->db('SELECT * FROM DI_test_records_V where rownum<2');
# perform the query
#$result = odbc_exec($connect, $query);
$xml = new DOMDocument("1.0", "utf-8");
$xml->formatOutput = true;
#$root = $xml->createElementNS('http://www.cancerresearchuk.org/di/r17/supplier/newdonate');
$gen = $xml->createElementNS("http://www.cancerresearchuk.org/di/r17/supplier/generic", "batch");
$xml->appendChild($gen);
$id = $xml->createElement("id", date('YmdHis'));
$gen->appendChild($id);
$ltran = $xml->createElement("listOfTransaction");
$gen->appendChild($ltran);
$tran = $xml->createElement("transaction");
$ltran->appendChild($tran);
while ($row = odbc_fetch_row($result)) {
$Trefe = $xml->createElement("reference", odbc_result($result, 1));
$tran->appendChild($Trefe);
$supporter = $xml->createElement("supporter");
$tran->appendChild($supporter);
$dob = $xml->createElement("dateOfBirth", odbc_result($result, 2));
$supporter->appendChild($dob);
$pExtRef = $xml->createElement("primaryExternalReferenceId", odbc_result($result, 3));
$supporter->appendChild($pExtRef);
$secondaryExternalReferenceId = $xml->createElement("secondaryExternalReferenceId", odbc_result($result, 4));
示例4: core
public function core($query)
{
# query the users table for name and surname
$sqlop = new db_connect();
#truncate current table before reloading
$sqlop->db('truncate table DI_test_records');
#insert the records into current table
$sqlop->db('insert into DI_test_records select * FROM DI_test_records_v');
$result = $sqlop->db('SELECT * FROM DI_test_records where rownum<2');
# perform the query
#$result = odbc_exec($connect, $query);
$xml = new DOMDocument("1.0", "utf-8");
$xml->formatOutput = true;
#$root = $xml->createElementNS('http://www.cancerresearchuk.org/di/r17/supplier/newdonate');
$gen = $xml->createElementNS("http://www.cancerresearchuk.org/di/r17/supplier/generic", "batch");
$xml->appendChild($gen);
$id = $xml->createElement("id", date('YmdHis'));
$gen->appendChild($id);
$ltran = $xml->createElement("listOfTransaction");
$gen->appendChild($ltran);
$tran = $xml->createElement("transaction");
$ltran->appendChild($tran);
while ($row = odbc_fetch_row($result)) {
$Trefe = $xml->createElement("reference", date('YmdHis'));
$tran->appendChild($Trefe);
$supporter = $xml->createElement("supporter");
$tran->appendChild($supporter);
$dob = $xml->createElement("dateOfBirth", odbc_result($result, "SUPP_DATEOFBIRTH"));
$supporter->appendChild($dob);
$pExtRef = $xml->createElement("primaryExternalReferenceId", odbc_result($result, "SUPP_primaryExternalRefId"));
$supporter->appendChild($pExtRef);
$secondaryExternalReferenceId = $xml->createElement("secondaryExternalReferenceId", odbc_result($result, "SUPP_secondaryExternalRefId"));
$supporter->appendChild($secondaryExternalReferenceId);
$PDataSo = $xml->createElement("primaryDataSourceCode", odbc_result($result, "SUPP_primaryDataSourceCode"));
$supporter->appendChild($PDataSo);
$secondaryDataSourceCode = $xml->createElement("secondaryDataSourceCode", odbc_result($result, "SUPP_secondaryDataSourceCode"));
$supporter->appendChild($secondaryDataSourceCode);
$fore = $xml->createElement("forename", odbc_result($result, "SUPP_forename"));
$supporter->appendChild($fore);
$gender = $xml->createElement("gender", odbc_result($result, "SUPP_gender"));
$supporter->appendChild($gender);
$initial = $xml->createElement("initial", odbc_result($result, "SUPP_initial"));
$supporter->appendChild($initial);
$SSdate = $xml->createElement("startDate", odbc_result($result, "SUPP_startDate"));
$supporter->appendChild($SSdate);
$SSource = $xml->createElement("source", odbc_result($result, "SUPP_source"));
$supporter->appendChild($SSource);
$SStatus = $xml->createElement("statusCode", odbc_result($result, "SUPP_statusCode"));
$supporter->appendChild($SStatus);
$SStDate = $xml->createElement("statusDate", odbc_result($result, "SUPP_statusDate"));
$supporter->appendChild($SStDate);
$suffix = $xml->createElement("suffix", odbc_result($result, "SUPP_suffix"));
$supporter->appendChild($suffix);
$SuppURN = $xml->createElement("supporterURN", odbc_result($result, "SUPP_supporterURN"));
$supporter->appendChild($SuppURN);
$surname = $xml->createElement("surname", odbc_result($result, "SUPP_surname"));
$supporter->appendChild($surname);
$Title = $xml->createElement("title", odbc_result($result, "SUPP_title"));
$supporter->appendChild($Title);
$changeofNameIndicator = $xml->createElement("changeofNameIndicator", odbc_result($result, "SUPP_changeofNameIndicator"));
$supporter->appendChild($changeofNameIndicator);
$nonTaxPayerFlag = $xml->createElement("nonTaxPayerFlag", odbc_result($result, "SUPP_nonTaxPayerFlag"));
$supporter->appendChild($nonTaxPayerFlag);
$nonTaxPayerStartDate = $xml->createElement("nonTaxPayerStartDate", odbc_result($result, "SUPP_nonTaxPayerStartDate"));
$supporter->appendChild($nonTaxPayerStartDate);
if (!empty(odbc_result($result, "SUPP_dateOfDeath"))) {
$dateOfDeath = $xml->createElement("dateOfDeath", odbc_result($result, "SUPP_dateOfDeath"));
$supporter->appendChild($dateOfDeath);
}
if (!empty(odbc_result($result, "SUPP_deathNotificationDate"))) {
$deathNotificationDate = $xml->createElement("deathNotificationDate", odbc_result($result, "SUPP_deathNotificationDate"));
$supporter->appendChild($deathNotificationDate);
}
$maritalStatus = $xml->createElement("maritalStatus", odbc_result($result, "SUPP_maritalStatus"));
$supporter->appendChild($maritalStatus);
$address = $xml->createElement("address");
$supporter->appendChild($address);
$addressLine1 = $xml->createElement("addressLine1", odbc_result($result, "ADDR_addressLine1"));
$address->appendChild($addressLine1);
$addressLine2 = $xml->createElement("addressLine2", odbc_result($result, "ADDR_addressLine2"));
$address->appendChild($addressLine2);
$addressLine3 = $xml->createElement("addressLine3", odbc_result($result, "ADDR_addressLine3"));
$address->appendChild($addressLine3);
$addressLine4 = $xml->createElement("addressLine4", odbc_result($result, "ADDR_addressLine4"));
$address->appendChild($addressLine4);
$cherishedAddressHouseName = $xml->createElement("cherishedAddressHouseName", odbc_result($result, "ADDR_cherishedAddressHN"));
$address->appendChild($cherishedAddressHouseName);
$city = $xml->createElement("city", odbc_result($result, "ADDR_city"));
$address->appendChild($city);
$country = $xml->createElement("country", odbc_result($result, "ADDR_country"));
$address->appendChild($country);
$county = $xml->createElement("county", odbc_result($result, "ADDR_county"));
$address->appendChild($county);
$postalCode = $xml->createElement("postalCode", odbc_result($result, "ADDR_postalCode"));
$address->appendChild($postalCode);
$startDate = $xml->createElement("startDate", odbc_result($result, "ADDR_startDate"));
$address->appendChild($startDate);
$validationStatus = $xml->createElement("validationStatus", odbc_result($result, "ADDR_validationStatus"));
$address->appendChild($validationStatus);
$newAddressIndicator = $xml->createElement("newAddressIndicator", odbc_result($result, "ADDR_newAddressIndicator"));
//.........这里部分代码省略.........