0

It may be simple question ,i am fresh to php,amazon I want to do batch put to my SDB database. I download s php-sdb sdk from amazon and did it successfully.

$bPut = $sdb->batch_put_attributes($domineName, array(
  'ItemOne' => array(
    'Company' => 'a',
  ),
  'ItemTwo' => array(
    'Company' => 'a',
  ),
  'ItemThree' => array(
    'Company' => 'a',
  )
), true, null);

its works fine.Now I want to make the array (the second parameter) dynamic ie I want to make itemOne,ItemTwo,ItemThree ... from SDB database , I did it using $key = implode($row['test']); But I am fail to create a multidimensional array successfully>how can I do it.Please help

Jamie Hutton
  • 260
  • 3
  • 13
Jisson
  • 3,566
  • 8
  • 38
  • 71
  • 1
    You need to merge 2 arrays? In PHP arrays are dynamic by default $array['ItemFour'] = array('company'=>'foo'); – zim32 Jun 07 '11 at 14:15
  • I actually want to craete a multidimensional array,and the key in the array from my data base itself.Ie I don't want to hard code the array,I want to craete it using some for loop ,for each loop etc. – Jisson Jun 07 '11 at 14:33

2 Answers2

1

This:

$items['ItemOne']['Company'] = 'a';
$items['ItemTwo']['Company'] = 'a';
$items['ItemThree']['Company'] = 'a';

will give you this:

array(
  'ItemOne' => array(
    'Company' => 'a'
  ),
  'ItemTwo' => array(
    'Company' => 'a'
  ),
  'ItemThree' => array(
    'Company' => 'a'
  )
);

And then you can use it like so:

$bPut = $sdb->batch_put_attributes($domineName, $items), true, null);
NightHawk
  • 3,633
  • 8
  • 37
  • 56
0

You can view and manage your uploaded data using SDB Explorer. In new upcoming version SDB Explorer will support bulk upload. You will be able to upload your large data in parallel threads.

http://www.sdbexplorer.com/

user261740
  • 59
  • 7