Render an array in Block_view I want to render an array and print the output as Block[content]. There is either my Foreach or the way I use $item array or $row that is wrong. I will appreciate your help.

The result i get is the HTML I define in Block[content] without the values of $row->uri, $row->title, $row->body_value. They are empty. And it means I have done something wrong. 

function produkt_block_view($delta = '')
{

  $block = array();

  $list = produkt_produkliste(1);    
  $items = array();
  foreach ($list as $row) {
    $items[1] = $row-&gt;uri;
    $items[2] = $row-&gt;title;
    $items[3] = $row-&gt;body_value;
  }


 switch($delta) {
  case 'produkt' :
    $block['content'] = '&lt;a href="/19"&gt;';
    $block['content'] .= '&lt;img class="pimg" src="'.$row-&gt;uri.'" alt="Se alle vores filter elementer her"&gt;';          
    $block['content'] .= '&lt;p class="pname"&gt;"'.$row-&gt;title.'"&lt;/p&gt;';
    $block['content'] .= '&lt;p&gt;"'.$row-&gt;body_value.'"&lt;/p&gt;';      
    $block['content'] .= theme ('item_list',array('items' =&gt; $items, 'type' =&gt; 'ol',   'attribute' =&gt; 'produkt'));      
    break;   
  }

  return $block;
}


And I ended with this solution that get some results.

function produkt_block_view($delta = '')
{

   $query  = db_query("SELECT node.title,    field_data_field_kortbeskrivelse.field_kortbeskrivelse_value, file_managed.uri
    FROM node 
    JOIN field_data_field_tilh_rsforhold ON
    node.nid = field_data_field_tilh_rsforhold.entity_id

    JOIN field_data_field_kortbeskrivelse ON
    node.nid = field_data_field_kortbeskrivelse.entity_id

    JOIN field_data_field_billede ON
    node.nid = field_data_field_billede.entity_id

    JOIN file_managed
    ON field_data_field_billede.field_billede_fid = file_managed.fid  


    WHERE field_data_field_tilh_rsforhold.field_tilh_rsforhold_target_id = 30
    AND  field_data_field_billede.bundle = 'produkt_kategori'
    "

      );



    $rows   = array();
    foreach ($query as $row) 
    {
        $rows[] = array(
        $row-&gt;title,
        $row-&gt;field_kortbeskrivelse_value,
        $row-&gt;uri
      );
            print_r($row-&gt;uri);

            $block['content'] = '&lt;a href="' . url(19) . '"&gt;&lt;img class="pimg" src=/"'.   $row-&gt;uri . '" alt="Se alle vores filter elementer her" /&gt;&lt;/a&gt;'; // assuming that anchor tag will wrap img          
            $block['content'] .= '&lt;p class="pname"&gt;' . $row-&gt;title . '&lt;/p&gt;';
            $block['content'] .= '&lt;p&gt;' . $row-&gt;field_kortbeskrivelse_value . '&lt;/p&gt;';      
            $block['content'] .= theme ('item_list',array('type' =&gt; 'ol',     'attribute' =&gt; 'produkt'));      

    }


  return $block;
 }
I don't think $block['content'] = '&lt;a href="/19"&gt;'; $block['content'] .= '&lt;img class="pimg" src="'.$row-&gt;uri.'" alt="Se alle vores filter elementer her"&gt;';... will work, . is a string(concatination) operator. You should create render array and assign it to $block['content'], example: 

$array = array('#markup' =&gt; 'SOME HTML');
$block['content'] = render($array);


EDIT:

After below comments, I played a little with hook_block_view hook, and I found out some information about it:


$block[subject] doesn't affect to its content even if you don't set it; content will be displayed without any subject (so, your missing subject doesn't cause any error here, as j.Reynolds mentioned);
$block['content'] can be string value and you don't need to render it, as Molot andj.Reynolds mentioned below, and you can concatinate it as many times as you want:)


So, if we return back to your snippet, you can try something like this:

$block['content'] = '&lt;a href="' . url(19) . '"&gt;&lt;img class="pimg" src="'. image_style_url('STYLE_NAME:E.G:LARGE', $row-&gt;uri) . '" alt="Se alle vores filter elementer her" /&gt;&lt;/a&gt;'; // assuming that anchor tag will wrap img          
$block['content'] .= '&lt;p class="pname"&gt;' . $row-&gt;title . '&lt;/p&gt;';
$block['content'] .= '&lt;p&gt;' . $row-&gt;body_value . '&lt;/p&gt;';      
$block['content'] .= theme ('item_list',array('items' =&gt; $items, 'type' =&gt; 'ol',   'attribute' =&gt; 'produkt'));


I don't know what $row-&gt;uri looks like in your code, but I assumed that it is something like public://FILE_NAME.EXT, if so you can use image_style_url function to generate image src..