Populate Array with values from another arrray [closed]

You can easily use foreach to achieve that,

$my_array = array();
foeach($wpArray as $row){
   $my_array[$row->ID] = $row->post_name;
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)