[英]Need Help on compare and add unique data from Multi dimensional array
我正在嘗試比較多維數組,並使用API將來自mysql的唯一數據添加到雲數據庫。
如果找不到匹配項,請執行搜索,然后添加它。 否則,跳到下一個。 我嘗試使用以下代碼,但未添加任何數據。
$records=array(
'SO Qty' => 'Dup !',
'WO Qty' => $row['Reference'],
'SO Date' => $row['TransactionDate'],
'Color' => $row['DistNumber'],
'SO#' => $row['Reference'],
'Promised Date' => $row['GoodThruDate'],
'SalesDescription' => $row['SalesDescription'],
);
$tv->addRecord($tableId, $records); // call to addRecord() which adds data to cloud DB
表A:我想向其中添加數據的表中的記錄
Array (
[id] => 3054535376
[table_id] => 50240233993
[created] => 2014-10-30T09:52:15-0600
[updated] => 2014-10-30T09:52:15-0600
[created_by] => 3045444045538
[fields] => Array (
[Work Order] => 87565
[SalesDescription] => 18X5X12 1/8 SOLID FORKLIFT TIRE PRESS-ONS
[SO#] => 14061
[SO Date] => 2013-10-16T00:00:00-0600
[Promised Date] => 2014-10-30T09:52:15-0600
[SO Qty] => 1.0000000000000000000
[WO Qty] => 14061
[Color] => 2
[s] => 2
[SHIP BY] => 2014-10-29
[CALC PROMISED DATE] => 2014-10-30
)
)
表B:從表中我要從中獲取數據的記錄
Array (
[0] => CAS001
[CustomerId] => CAS001
[1] => CASH CUSTOMER
[Customer_Bill_Name] => CASH CUSTOMER
[2] => Will Call
[WhichShipVia] => Will Call
[3] => [INV_POSOOrderNumber] => [4] => 2013-07-24
[ShipByDate] => 2013-07-24
[5] => [GoodThruDate] => [6] => [CustomerSONo] => [7] => 13867
[Reference] => 13867 [8] => 2013-07-24
[TransactionDate] => 2013-07-24
[9] => 1
[DistNumber] => 1
[10] => 2.0000000000000000000
[Quantity] => 2.0000000000000000000
[11] => 121130581
[ItemId] => 121130581
[12] => 18X5X12 1/8 SOLID FORKLIFT TIRE PRESS-ONS
[SalesDescription] => 18X5X12 1/8 SOLID FORKLIFT TIRE PRESS-ONS
[13] => [PartNumber] => [14] => 18X5X12 1/8 SOLID FORKLIFTTIRE
[ItemDescription] => 18X5X12 1/8 SOLID FORKLIFTTIRE
)
$dont_write
永遠不會設置為0?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.