本文整理汇总了PHP中get_db_error函数的典型用法代码示例。如果您正苦于以下问题:PHP get_db_error函数的具体用法?PHP get_db_error怎么用?PHP get_db_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_db_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
function delete($sign_id)
{
$strWhere[SIGN_ID] = $sign_id;
$strValues[] = "count(*) as cnt";
// check if owner have existing transactions
$result = ebpls_delete_data($this->m_dbLink, EBPLS_SIGNATORIES_TABLE, $strWhere);
if ($result < 0) {
$this->setError($result, get_db_error());
}
return $result;
}
示例2: selectNonSystemData
function selectNonSystemData($formula_id = NULL, $formula_desc = NULL, $formula_type = NULL, $system_data = NULL, $page = 1, $maxrec = 20, $orderby = EBPLS_FORMULAS_CREATE_TS, $is_desc = false)
{
if ($formula_id != NULL && $formula_id != "") {
$strWhere[EBPLS_FORMULAS_FORMULA_ID] = $formula_id;
}
if ($formula_desc != NULL && $formula_desc != "") {
$strWhere[EBPLS_FORMULAS_FORMULA_DESC] = array("like", "{$formula_desc}%");
}
if ($formula_type != NULL && $formula_type != "") {
$strWhere[EBPLS_FORMULAS_FORMULA_TYPE] = $formula_type;
}
if (!is_null($system_data) && ($system_data == "0" || $system_data == "1")) {
$strWhere[EBPLS_FORMULAS_SYSTEMDATA] = $system_data;
}
// select all columns
$strValues[] = "*";
if ($orderby != NULL) {
$strOrder[$orderby] = $orderby;
} else {
$strOrder[$orderkey] = EBPLS_FORMULAS_FORMULA_ID;
}
$result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_FORMULAS_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec);
if (!is_array($result) && $result < 0) {
$this->setError($result, get_db_error());
return $result;
} else {
// transform result to EBPLTaxFeeSysRef object
for ($i = 0; $i < count($result["result"]); $i++) {
$records[$i] = new TaxFeeFormula($this->m_dbLink, false);
$obj = unserialize($result["result"][$i][EBPLS_FORMULAS_FORMULA_CLASS]);
$records[$i]->setData(NULL, $result["result"][$i]);
}
$result["result"] = $records;
return $result;
}
}
示例3: assignPermitCode
function assignPermitCode($code)
{
$strValues[FRANCHISE_PERMIT_CODE] = $code;
$strWhere[FRANCHISE_PERMIT_ID] = $this->data_elems[FRANCHISE_PERMIT_ID];
$ret = ebpls_update_data($this->m_dbLink, EBPLS_FRANCHISE_PERMIT_TABLE, $strValues, $strWhere);
if ($ret < 0) {
$this->setError($ret, $str = get_db_error());
$this->debug("UPDATE FRA PERMIT FAILED [error:{$ret},msg=" . $str . "]");
return $ret;
} else {
$this->debug("UPDATE FRA PERMIT SUCCESSFULL [{$ret}]");
return $ret;
}
}
示例4: add
function add()
{
if ($this->m_dbLink) {
$this->data_elems[TRANS_BUSNATURE_FOR_YEAR] = date("Y");
$this->data_elems[TRANS_BUSNATURE_TS_CREATE] = date("Y-m-d H:i:s");
$this->data_elems[TRANS_BUSNATURE_TS_UPDATE] = date("Y-m-d H:i:s");
if (($error_num = $this->validateData()) > 0) {
$strValues = $this->getData();
$ret = ebpls_insert_data($this->m_dbLink, TRANS_BUSNATURE_TABLE, $strValues);
if ($ret < 0) {
$this->debug("CREATE EBPLSTransactionBusinessNature FAILED [error:{$ret},msg=" . get_db_error() . "]");
$this->setError($ret, get_db_error());
return $ret;
} else {
$this->debug("CREATE EBPLSTransactionBusinessNature SUCCESSFULL [{$ret}]");
return 1;
}
} else {
//print_r($this->getError());
$this->debug("CREATE EBPLSTransactionBusinessNature FAILED [error:{$ret},msg=" . get_db_error() . "]");
return $error_num;
}
} else {
$this->debug("CREATE EBPLSTransactionBusinessNature FAILED INVALID DB LINK {$this->m_dbLink}");
$this->setError($ret, "Invalid Db link {$this->m_dbLink}");
return -1;
}
}
示例5: load
function load()
{
$strValues[$key] = "*";
//$strWhere[BUSINESS_ID] = $this->business_id;
$strWhere[NATURE_BUSINESS_NATURE_CODE] = $this->getData(NATURE_BUSINESS_NATURE_CODE);
$result = ebpls_select_data($this->m_dbLink, NATURE_BUSINESS_REF_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL);
if (is_array($result)) {
$this->data_elems[NATURE_BUSINESS_ID] = $this->business_id;
$this->data_elems[NATURE_BUSINESS_NATURE_CODE] = $result[0][NATURE_BUSINESS_NATURE_CODE];
unset($this->data_elems[NATURE_BUSINESS_NATURE_DESC]);
return 1;
} else {
if ($result < 0 || $result == "") {
$this->setError(-1, "EBPLSEnterpriseNature with nature code " . $strWhere[NATURE_BUSINESS_NATURE_CODE] . " not found.[{$result}]");
} else {
$this->setError($result, get_db_error());
}
return -1;
}
}
示例6: search
function search($operator_id, $motor_model = NULL, $motor_no = NULL, $chassis_no = NULL, $plate_no = NULL, $body_no = NULL, $page = 1, $maxrec = 1000000, $orderkey = EBPLS_MOTORIZED_VEH_MOTOR_ID, $is_desc = true)
{
if ($operator_id != NULL) {
$strWhere[EBPLS_MOTORIZED_VEH_OPERATOR_ID] = $operator_id;
}
if ($motor_model != NULL) {
$strWhere[EBPLS_MOTORIZED_VEH_MOTOR_MODEL] = array("like", "{$motor_model}%");
}
if ($motor_no != NULL) {
$strWhere[EBPLS_MOTORIZED_VEH_MOTOR_NO] = array("like", "{$motor_no}%");
}
if ($chassis_no != NULL) {
$strWhere[EBPLS_MOTORIZED_VEH_CHASSIS_NO] = array("like", "{$chassis_no}%");
}
if ($plate_no != NULL) {
$strWhere[EBPLS_MOTORIZED_VEH_PLATE_NO] = array("like", "{$plate_no}%");
}
if ($body_no != NULL) {
$strWhere[EBPLS_MOTORIZED_VEH_BODY_NO] = array("like", "{$body_no}%");
}
// select all columns
$strValues[] = "*";
if ($orderkey != NULL) {
$strOrder[$orderkey] = $orderkey;
} else {
$strOrder = $orderkey;
}
if (count($strWhere) <= 0) {
$this->setError(-1, "No search parameters.");
return -1;
}
$result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_MOTORIZED_VEHICLES_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec);
if (!is_array($result) && $result < 0) {
$this->setError($result, get_db_error());
return $result;
} else {
// transform result to EBPLSOwner object
for ($i = 0; $i < count($result["result"]); $i++) {
$records[$i] = new EBPLSMotorizedVehicle($this->m_dbLink);
$records[$i]->setData(NULL, $result["result"][$i]);
}
$result["result"] = $records;
return $result;
}
}
示例7: delete
function delete($owner_id)
{
$strWhere[CIT_ID] = $owner_id;
$strValues[] = "count(*) as cnt";
// check if owner have existing transactions
$result = ebpls_delete_data($this->m_dbLink, EBPLS_CTC_INTEREST_TABLE, $strWhere);
if ($result < 0) {
$this->setError($result, get_db_error());
}
return $result;
}
示例8: delete
function delete($owner_id)
{
$strWhere[OCCUPANCY_TYPE_CODE] = $owner_id;
//$strValues[] = "count(*) as cnt";
$result = ebpls_delete_data($this->m_dbLink, EBPLS_OCCUPANCY_TYPE_TABLE, $strWhere);
if ($result < 0) {
$this->setError($result, get_db_error());
}
return $result;
}
示例9: select
function select($code = NULL, $page = 1, $maxrec = 100000000, $orderkey = SYSREF_CODE, $is_desc = true)
{
if ($code != NULL) {
$strWhere[$this->m_strCodeKey] = $code;
}
if ($orderkey != SYSREF_CODE && $orderkey != SYSREF_DESC && $orderkey != SYSREF_CREATE_TS && $orderkey != SYSREF_UPDATE_TS && $orderkey != SYSREF_ADMIN) {
$this->setError(-1, "Invalid order key value {$orderkey}.");
return -1;
}
// select all columns
$strValues[] = "*";
if ($orderkey != NULL) {
$strOrder[$this->m_strTableKeyConst . $orderkey] = $this->m_strTableKeyConst . $orderkey;
} else {
$strOrder = $this->m_strCodeKey;
}
$result = ebpls_select_data_bypage($this->m_dbLink, $this->m_strTableKey, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec);
if (!is_array($result) && $result < 0) {
$this->setError($result, get_db_error());
return $result;
} else {
// transform result to EBPLSSysRef object
for ($i = 0; $i < count($result["result"]); $i++) {
$records[$i] = new EBPLSSysRef($this->m_dbLink, $this->m_strTableKey);
$records[$i]->setData(NULL, $result["result"][$i]);
$records[$i]->m_strCode = $records[$i]->getData($this->m_strCodeKey);
$records[$i]->m_strDesc = $records[$i]->getData($this->m_strDescKey);
$records[$i]->m_tsCreate = $records[$i]->getData($this->m_strCreateKey);
$records[$i]->m_tsUpdate = $records[$i]->getData($this->m_strUpdateKey);
$records[$i]->m_strAdmin = $records[$i]->getData($this->m_strAdminKey);
}
$result["result"] = $records;
return $result;
}
}
示例10: search
/**
* Find function searches Owner table for users having exact values for firstname, lastname, middlename, email address, birthdate.
*
* Set a NULL value to any of the parameters a users wishes not included on the search function.
*
* Search uses AND on query on all of the non-NULL parameters provided. Exact string match is implemented.
*
* Search result can be order by setting orderkey as any of the pre-defined data elements constants defined above,
* set $is_desc to true to use DESC otherwise set to false.
*
* Paging is automatically provided by letting users of this method provide the page number and the max records per page.
* Page result are automaticallly selected give these information, by rule $maxrec should be > 0 and $page should be > 1 and < maxpages
*
* Result of this method is a 2-dim array, having keys "page_info" and "result"
* First element of result having key "page_info" contains all the information regarding the query
* total = number of total records of search
* max_pages = number of pages in search
* count = number of records on current page
* page = current page selected
* Second element of array having key "result" contains result of the search. "result" search value is an array of EBLPSCTC objects
*
*
*/
function search($fname = NULL, $mname = NULL, $lname = NULL, $email = NULL, $bdate = NULL, $page = 1, $maxrec = 1000000000, $orderkey = OWNER_REG_DATE, $is_desc = true)
{
if ($fname != NULL) {
$strWhere[OWNER_FIRST_NAME] = array("like", "{$fname}%");
} else {
if ($this->data_elems[OWNER_FIRST_NAME] != "") {
$strWhere[OWNER_FIRST_NAME] = array("like", $this->data_elems[OWNER_FIRST_NAME] . "%");
}
}
if ($mname != NULL) {
$strWhere[OWNER_MIDDLE_NAME] = array("like", "{$mname}%");
} else {
if ($this->data_elems[OWNER_MIDDLE_NAME] != "") {
$strWhere[OWNER_MIDDLE_NAME] = array("like", $this->data_elems[OWNER_MIDDLE_NAME] . "%");
}
}
if ($lname != NULL) {
$strWhere[OWNER_LAST_NAME] = array("like", "{$lname}%");
} else {
if ($this->data_elems[OWNER_LAST_NAME] != "") {
$strWhere[OWNER_LAST_NAME] = array("like", $this->data_elems[OWNER_LAST_NAME] . "%");
}
}
if ($address != NULL) {
$strWhere[OWNER_EMAIL_ADDRESS] = array("like", "{$email}%");
} else {
if ($this->data_elems[OWNER_EMAIL_ADDRESS] != "") {
$strWhere[OWNER_EMAIL_ADDRESS] = array("like", $this->data_elems[OWNER_EMAIL_ADDRESS] . "%");
}
}
if ($bdate != NULL) {
$strWhere[OWNER_BIRTH_DATE] = "{$bdate}";
} else {
if ($this->data_elems[OWNER_BIRTH_DATE] != "") {
$strWhere[OWNER_BIRTH_DATE] = $this->data_elems[OWNER_BIRTH_DATE];
}
}
// select all columns
$strValues[] = "*";
if ($orderkey != NULL) {
$strOrder[$orderkey] = $orderkey;
} else {
$strOrder = $orderkey;
}
if (count($strWhere) <= 0) {
$this->setError(-1, "No search parameters.");
return -1;
}
$result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_OWNER_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec);
if (!is_array($result) && $result < 0) {
$this->setError($result, get_db_error());
return $result;
} else {
// transform result to EBPLSOwner object
for ($i = 0; $i < count($result["result"]); $i++) {
$records[$i] = new EBPLSOwner($this->m_dbLink);
$records[$i]->setData(NULL, $result["result"][$i]);
}
$result["result"] = $records;
return $result;
}
}
示例11: select
function select($permit_type = NULL, $trans_type = NULL, $page = 1, $maxrec = 10, $orderkey = "", $is_desc = true)
{
// either MOT,PED,BUS,OCC etc...
if ($permit_type != NULL) {
if (EBPLS_PDR_PR_TYPE_APP == $this->m_strType) {
$strWhere[EBPLS_PAR_PERMIT_TYPE] = $permit_type;
if ($trans_type != NULL) {
$strWhere[EBPLS_PAR_TRANS_TYPE] = $trans_type;
}
if ($permit_type != NULL) {
$strWhere[EBPLS_PAR_PERMIT_TYPE] = $permit_type;
}
} else {
if (EBPLS_PDR_PR_TYPE_TAX == $this->m_strType) {
$strWhere[EBPLS_PTR_PERMIT_TYPE] = $permit_type;
if ($trans_type != NULL) {
$strWhere[EBPLS_PTR_TRANS_TYPE] = $trans_type;
}
if ($permit_type != NULL) {
$strWhere[EBPLS_PTR_PERMIT_TYPE] = $permit_type;
}
} else {
if (EBPLS_PDR_PR_TYPE_FEE == $this->m_strType) {
$strWhere[EBPLS_PFR_PERMIT_TYPE] = $permit_type;
if ($trans_type != NULL) {
$strWhere[EBPLS_PFR_TRANS_TYPE] = $trans_type;
}
if ($permit_type != NULL) {
$strWhere[EBPLS_PFR_PERMIT_TYPE] = $permit_type;
}
}
}
}
}
if ($orderkey != NULL) {
$strOrder[$orderkey] = $orderkey;
} else {
$strOrder[$this->m_strPrimaryKey] = $this->m_strPrimaryKey;
}
$strValues[] = "*";
$result = ebpls_select_data_bypage($this->m_dbLink, $this->m_strTable, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec);
if (!is_array($result) && $result < 0) {
$this->setError($result, get_db_error());
return $result;
} else {
// transform result to EBPLSPermitDefaultRequirements object
for ($i = 0; $i < count($result["result"]); $i++) {
$records[$i] = new EBPLSPermitDefaultRequirements($this->m_dbLink, false);
//print_r($result["result"][$i]);
$records[$i]->setData(NULL, $result["result"][$i]);
}
$result["result"] = $records;
return $result;
}
}
示例12: findBusinessCTC
function findBusinessCTC($ctc_code, $company, $address, $org_type, $bus_nature, $date_issued, $page, $maxrec = 10, $orderkey = CTC_DATE_ISSUED, $is_desc = true)
{
if ($ctc_code != NULL) {
$strWhere[CTC_CODE] = $ctc_code;
}
if ($company != NULL) {
$strWhere[CTC_COMPANY] = array("like", "{$company}%");
}
if ($address != NULL) {
$strWhere[CTC_COMPANY_ADDRESS] = array("like", "{$address}%");
}
if ($org_type != NULL) {
$strWhere[CTC_ORGANIZATION_TYPE] = $org_type;
}
if ($bus_nature != NULL) {
$strWhere[CTC_BUSINESS_NATURE] = array("like", "{$bus_nature}%");
}
if ($date_issued != NULL) {
$strWhere[CTC_DATE_ISSUED] = array("regexp", "{$date_issued}");
}
$strValues[] = "*";
$strOrder[$orderkey] = $orderkey;
$result = ebpls_select_data_bypage($this->m_dbLink, $this->m_strTable, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec);
if (!is_array($result) && $result < 0) {
$this->m_arrError["err_code"] = $result;
$this->m_arrError["err_mesg"] = get_db_error();
return $result;
} else {
// transform result to EBPLCTC object
for ($i = 0; $i < count($result["result"]); $i++) {
$records[$i] = new EBPLSCTC($this->m_dbLink, CTC_TYPE_INDIVIDUAL);
$records[$i]->setData(NULL, $result["result"][$i]);
}
$result["result"] = $records;
return $result;
}
}
示例13: computeTransactionTotalTaxFeeDue
function computeTransactionTotalTaxFeeDue($trans_id)
{
$strValues[$key] = "sum(tax_total_amount_due)";
$strWhere[TF_TRANS_ID] = $trans_id;
$result = ebpls_select_data($this->m_dbLink, TF_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL);
if (is_array($result)) {
return $result[0][0];
} else {
$this->setError($result, get_db_error());
return -1;
}
}
示例14: selectWithSystemData
function selectWithSystemData($code = NULL, $desc = NULL, $type = NULL, $system_data = NULL, $page = 1, $maxrec = 1, $orderkey = EBPLS_TAX_FEE_CODE, $is_desc = true)
{
if ($code != NULL && $code != "") {
$strWhere[EBPLS_TAX_FEE_CODE] = $code;
}
if ($desc != NULL && $desc != "") {
$strWhere[EBPLS_TAX_FEE_DESC] = array("like", "{$desc}%");
}
if ($type != NULL) {
if (is_array($type)) {
$strWhere[EBPLS_TAX_FEE_TYPE] = array("IN", " ( '" . join("','", $type) . "')");
} else {
$strWhere[EBPLS_TAX_FEE_TYPE] = $type;
}
}
if (!is_null($system_data) && ($system_data == "0" || $system_data == "1")) {
$strWhere[EBPLS_TAX_SYSTEMDATA] = $system_data;
}
// select all columns
$strValues[] = "*";
if ($orderkey != NULL) {
$strOrder[$orderkey] = $orderkey;
} else {
$strOrder[$orderkey] = EBPLS_TAX_FEE_CODE;
}
$result = ebpls_select_data_bypage($this->m_dbLink, EBPLS_TAX_FEE_TABLE, $strValues, $strWhere, NULL, $strOrder, $is_desc ? "DESC" : "ASC", $page, $maxrec);
if (!is_array($result) && $result < 0) {
$this->setError($result, get_db_error());
return $result;
} else {
for ($i = 0; $i < count($result["result"]); $i++) {
$records[$i] = new EBPLTaxFeeSysRef($this->m_dbLink, false);
$clsFormula = new TaxFeeFormula($this->m_dbLink, false);
$ret = $clsFormula->view($result["result"][$i][EBPLS_TAX_FORMULA_ID]);
if ($ret > 0) {
$result["result"][$i][EBPLS_TAX_FORMULA] = unserialize($clsFormula->getData(EBPLS_FORMULAS_FORMULA_CLASS));
if (!$result["result"][$i][EBPLS_TAX_FORMULA]) {
$this->debug("<HR>Error loading formula : " . $result["result"][$i][EBPLS_TAX_FORMULA_ID] . "!<HR>");
$this->setError(-2, "Invalid formula on unserialize : " . $result["result"][$i][EBPLS_TAX_FORMULA_ID] . "!");
$this->debug("Invalid formula on unserialize : " . $result["result"][$i][EBPLS_TAX_FORMULA_ID] . "!");
return -2;
}
$result["result"][$i][EBPLS_TAX_FORMULA]->setData(NULL, $clsFormula->getData());
$records[$i]->setData(NULL, $result["result"][$i]);
} else {
echo 'ID: ' . $result["result"][$i][EBPLS_TAX_FORMULA_ID];
return $ret;
}
}
$result["result"] = $records;
return $result;
}
}
示例15: getTotalAmountDue
function getTotalAmountDue($trans_id, $tax_fee_code = NULL, $payment_status = NULL)
{
$strValues[$key] = " sum(payment_total_amount_due) as t1,sum(payment_amount_paid) as t2,sum(payment_penalty_amount) as p1,sum(payment_penalty_amount_paid) as p2,sum(payment_interest_amount) as i1,sum(payment_interest_amount_paid) as i2 ";
$strWhere[TPS_TRANS_ID] = $trans_id;
if ($tax_fee_code != NULL) {
$strWhere[TPS_PAYMENT_TAX_FEE_CODE] = $tax_fee_code;
}
if ($payment_status != NULL) {
$strWhere[TPS_PAYMENT_STATUS] = $payment_status;
}
$result = ebpls_select_data($this->m_dbLink, TPS_TABLE, $strValues, $strWhere, NULL, $strOrderBy, "DESC", NULL);
if (is_array($result)) {
$row = $result[0];
$amount_due = floatval($row["t1"]) - floatval($row["t2"]);
$amount_due += floatval($row["p1"]) - floatval($row["p2"]);
$amount_due += floatval($row["i1"]) - floatval($row["i2"]);
//$this->debug("getTotalAmountDue ok, return $amount_due.");
return round($amount_due, 2);
} else {
$this->setError($result, get_db_error());
return -1;
}
}