A simple query |
[eluser]sudinem[/eluser]
I got stuck on how to show the field name and value at once for example: $result=$this->description_model->get_desc_by_id('1'); I can get the values by: foreach($result->row as $values) { echo $values; } how to get the field name so as to display field name as well as their respective values. Sudinem
[eluser]danmontgomery[/eluser]
No way of knowing what get_desc_by_id() returns, but if it were a mysql result with a single row: Code: $query = $this->db->where('id', $id)->get('some_table'); http://ellislab.com/codeigniter/user-gui...sults.html http://php.net/manual/en/control-structures.foreach.php
|
Welcome Guest, Not a member yet? Register Sign In |