當前位置: 首頁>>代碼示例>>PHP>>正文


PHP mydb::getOne方法代碼示例

本文整理匯總了PHP中mydb::getOne方法的典型用法代碼示例。如果您正苦於以下問題:PHP mydb::getOne方法的具體用法?PHP mydb::getOne怎麽用?PHP mydb::getOne使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mydb的用法示例。


在下文中一共展示了mydb::getOne方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: error

<?php

//$shopnr = $_GET['Shop'];
$shopnr = '';
include_once "conf{$shopnr}.php";
include_once "error.php";
//Fehlerinstanz
$api = php_sapi_name();
$err = new error($api);
include_once "dblib.php";
include_once "pepper.php";
include_once "erplib.php";
$erpdb = new mydb($ERPhost, $ERPdbname, $ERPuser, $ERPpass, $ERPport, 'pgsql', $err, $debug);
$shopdb = new mydb($SHOPhost, $SHOPdbname, $SHOPuser, $SHOPpass, $SHOPport, 'mysql', $err, $debug);
$sql = "SELECT * FROM custom_variable_configs WHERE name = 'pepperkunde'";
$rs = $erpdb->getOne($sql);
if (isset($rs['id'])) {
    $cvarid = $rs['id'];
} else {
    exit;
}
$sql = "SELECT k_ID,Kunden_NR FROM kunde WHERE Kunden_NR != '0'";
$kunden = $shopdb->getAll($sql);
$sqlkdnr = "SELECT id FROM customer WHERE customernumber = '%s' ";
$sqldel = "DELETE FROM custom_variables WHERE config_id={$cvarid} AND trans_id=";
$sqlins = "INSERT INTO custom_variables (config_id,trans_id,text_value) VALUES ({$cvarid},%d,'%s')";
$i = 0;
if ($kunden) {
    foreach ($kunden as $nr) {
        $rs = $erpdb->getOne(sprintf($sqlkdnr, $nr['kunden_nr']));
        if (isset($rs['id'])) {
開發者ID:vanloswang,項目名稱:kivitendo-crm,代碼行數:31,代碼來源:mkShop2ERPcvar.php

示例2: error

<?php

//$shopnr = $_GET['Shop'];
$shopnr = '';
include_once "conf{$shopnr}.php";
include_once "error.php";
//Fehlerinstanz
$api = php_sapi_name();
$err = new error($api);
include_once "dblib.php";
include_once "pepper.php";
include_once "erplib.php";
$erpdb = new mydb($ERPhost, $ERPdbname, $ERPuser, $ERPpass, $ERPport, 'pgsql', $err, $debug);
$shopdb = new mydb($SHOPhost, $SHOPdbname, $SHOPuser, $SHOPpass, $SHOPport, 'mysql', $err, $debug);
$sql = "SELECT k_ID,Kunden_NR FROM kunde WHERE Kunden_NR != '0'";
$kunden = $shopdb->getAll($sql);
$sqlkdnr = "SELECT customernumber FROM customer WHERE id = ";
$sqlupd = "UPDATE kunde SET Kunden_NR = '%s' WHERE k_ID = %d";
if ($kunden) {
    foreach ($kunden as $nr) {
        $rs = $erpdb->getOne($sqlkdnr . $nr['kunden_nr']);
        if (isset($rs['customernumber'])) {
            echo $nr['k_id'] . " -> " . $rs['customernumber'] . "\n";
            $rc = $shopdb->query(sprintf($sqlupd, $rs['customernumber'], $nr['k_id']));
        }
    }
}
開發者ID:vanloswang,項目名稱:kivitendo-crm,代碼行數:27,代碼來源:mkShopID2KDnr.php


注:本文中的mydb::getOne方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。