0

Im having trouble when i declare my array. below is my code

$data_prod = array(
    'product_sku' => $product_sku,
    'BrandUUID' => $BrandUUID,
    'MainCategoryUUID' => $MainCategoryUUID,
    'ParentCategoryUUID' => $ParentCategoryUUID,
    'ChildCategoryUUID' => $ChildCategoryUUID,
    'product_name' => $product_name,
    'product_type' => 'PROD',
    'price' => preg_replace("/[^0-9]/","", $value['PRICE']),
    'weight'=>$value['WEIGHT'],
    'description'=>$value['DESCRIPTION'],
    'image_thumbnail' => '/img/prod_gallery/'.$value['IMAGE'],
    'status'=> $value['STATUS'],,
    'is_preorder'=> $value['FLAG_PRE_ORDER'],
    'is_featured'=> $value['FLAG_FEATURED'],
    'created_by' => 'SYSTEM',
    'created_date' => date('Y-m-d H:i:s'),
    'ByUserUUID' => $this->session->userdata('UserUUID')->AdminUUID,
    'ByUserIP' => $this->session->userdata('UserIP'),
    'OnDateTime' => date('Y-m-d H:i:s')
);

But i always got an error

Array
(
    [type] => 64
    [message] => Cannot use empty array elements in arrays

Could anybody give me solution about this problem ?

3
  • 5
    Remove a comma from here: 'status'=> $value['STATUS'],, -> 'status'=> $value['STATUS'], Commented Jun 26, 2018 at 11:15
  • 2
    But i always got an error from where ? Commented Jun 26, 2018 at 11:15
  • Ah i see so the problem is because of double comma. That solve the problem. Thank you Commented Jun 26, 2018 at 11:18

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.