Easy Question - Comments_View and Showing Article

well you can search the php manual on looping around the keys.

function test_print($item2, $key)
    echo "$key = $item2";
echo "<h3>";
array_walk($query, 'test_print');
echo "</h3>";
but the method you suggested is a perfectly valid way. it enables you to position your data where you want.

Thanks all. I realize this is not CI specific stuff I'm questioning - so thanks for the quick help. Exactly what I was looking for.


foreach ($query as $value) {
  echo $value;

[eluser]Pascal Kriete[/eluser]
You can change the controller a little:
function comments($id)
    $query = $this->db->get_where('entries', array('id' => $id), 1, 0);
    $query = $query->row_array();

    foreach($query as $key => $field)
        $data[$key] = $field;

    $this->load->view('whatever', $data);

/* View */


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.