简体   繁体   中英

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.

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

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

 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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