• 10-11-2023, 14:27:19
    #1
     $data = [
                 'barcode' => $getProduct->barcode,
                   ];
    
                            $productMatching = ProductMatching::firstOrCreate(
                                ['barcode' => $getProduct->barcode,],  
                                $data 
                            );
    
                            if($getProduct->barcode !== $productMatching->barcode){
    
                                echo 'Hata. '.$getProduct->barcode.' - '.$productMatching->barcode;
    
                            }
    Hata. 2222002BÇ - 2222002BC
    2222002BÇ verisi yolladığında 2222002BC bu veriyi görüyor. İşin kötü yanı tüm sorgularda bu şekilde. Bunu nasıl düzeltirim.
    utf8mb4_unicode_ci
  • 10-11-2023, 14:31:25
    #2
    sancakmedia adlı üyeden alıntı: mesajı görüntüle
     $data = [
                                'stock_code' => $getProduct->stockCode,
                                'barcode' => $getProduct->barcode,
                                'photo_url' => $getProduct->images[0]->url,
                                'service' => "trendyol",
                                'note' => "Trendyol Modülü Tarafından '".$getProduct->title."' ürünü için açılmıştır.",
                            ];
    
                            $productMatching = ProductMatching::firstOrCreate(
                                ['barcode' => $getProduct->barcode, 'service' => "trendyol"],  // eğer stock_code değeri bu ise
                                $data  // stock_code değeri ile eşleşen kayıt yoksa yeni bir kayıt oluştur
                            );
    
                            if($getProduct->barcode !== $productMatching->barcode){
    
                                echo 'Hata. '.$getProduct->barcode.' - '.$productMatching->barcode;
    
                            }
    Hata. 2222002BÇ - 2222002BC
    2222002BÇ verisi yolladığında 2222002BC bu veriyi görüyor. İşin kötü yanı tüm sorgularda bu şekilde. Bunu nasıl düzeltirim.
    utf8mb4_unicode_ci
    utf8_general_ci olarak değiştirin düzelsin hepsi yedek aldıktan sonra aşağıdaki işlemi denemenizi öneririm.

    ALTER TABLE $table CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci
  • 10-11-2023, 14:36:59
    #3
    utf8mb4_unicode_ci doğru set değil mi?