简体   繁体   English

在比较和添加多维数组中的独特数据时需要帮助

[英]Need Help on compare and add unique data from Multi dimensional array

I'm trying to compare Multi dimensional array and add unique data from mysql to cloud DB using API. 我正在尝试比较多维数组,并使用API​​将来自mysql的唯一数据添加到云数据库。

Perform the search if it doesn't find a match, then add it. 如果找不到匹配项,请执行搜索,然后添加它。 otherwise skip to the next. 否则,跳到下一个。 I tried use the following code but it doesn't add any data. 我尝试使用以下代码,但未添加任何数据。

      $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

Table A: record from the table where I would like to add data into 表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 
                        ) 
   ) 

Table B: record from the table where I would like to get data from 表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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM