I am using CodeIgniter 2.1.0 and MySQL. I want to display a horizontal data row as a vertical one. When I fetch a single row from the database and echo it, it looks like
----------------------------------------
id | name | address | email |
----------------------------------------
1 | Foo | Bar | foo@bar.com |
----------------------------------------
I have used CodeIgniters table library to generate the above table. instead of this, I want it show like this:
------
id : 1
name: foo
address : bar
email: foo@bar.com
-------------------
How do I do this with CodeIgniter 2.1.0?
If you have any problem to implement my previous answer… Here is the details…
Let me know is it useful or not?
Thanks.
/* for controller */
$data[‘user_data’] = $this->modle_name->function_name;
modle_name= your modle name where the specific function exists.
function_name= function into the modle by which you get all the table value from mysql db.
then write the function currectly in modle and go to the view page:it may be like that
/* model */
/* for view */