CodeIgniter Forums
Insert() method question of the database class - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Insert() method question of the database class (/showthread.php?tid=9037)



Insert() method question of the database class - El Forum - 06-09-2008

[eluser]phybertek[/eluser]
Hello,

I am inserting comments in to a listing I am writing. I'm using the Active Record method insert. I'm trying to figure out the best way to reserve or convert \n to <br>.

When data is posted this is what I see when I output the data from the database:

Input:

Hello, this is really coool!

-Phybertek

Results:

Hello, this is really cool! -Phybertek

-=-=-
Any ideas on the best way to input this data or output it?

Code:
public function comment_add()    
{

    // Insert into comments    
    $this->db->insert('comments',$_POST);
    redirect('list/event/' . $_POST['id'], 'location');


} //end comment_add
Even this post on this forum doesn't respect tabs.. How can you do this?


Insert() method question of the database class - El Forum - 06-09-2008

[eluser]gtech[/eluser]
does this help?
[url="http://uk2.php.net/manual/en/function.nl2br.php"]http://uk2.php.net/manual/en/function.nl2br.php[/url]


Insert() method question of the database class - El Forum - 06-09-2008

[eluser]phybertek[/eluser]
Yes it does buddy! :-)

Thanks..

-Ptek


Insert() method question of the database class - El Forum - 06-09-2008

[eluser]gtech[/eluser]
coooool

btw if you put your code in

[ code ]
[ /code ]

tags in the forum your tabs will appear in the code.


Insert() method question of the database class - El Forum - 06-10-2008

[eluser]phybertek[/eluser]
:-) Nice to know.. hehehehhe..!