Solarpitch Posted April 1, 2011 Share Posted April 1, 2011 Hi Guys, I have the following code that I'm getting from my database. This is how it appears in the DB. <div id="reply_flash"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td style="font-family: Arial; font-size: 14px; line-height: 19px; text-align: left; color: rgb(102, 102, 102);"> <br> <div style="font-family: Georgia; font-size: 19px; line-height: 20px; color: rgb(88, 43, 0); font-weight: normal; text-align: left;">This is a heading</div> <p>This is some text in this area.</p> <a href="#"><strong>Read more</strong></a> </td> </tr> </table> </div> When the user goes to edit the page, I'm retrieving the above from the database: http://www.mysite.com/newsletter/edit/56 // Controller to handle the request public function edit() { $id = $this->uri->segment(3); $data['get_newsletter'] = $this->Newsletter_model->get_newsletter($id); $this->load->view('header'); $this->load->view('newsletter/edit', $data); $this->load->view('footer'); } // View to display the request foreach($get_newsletter as $row) { $code = $row->code; $newsletter_id = $row->id; } echo $code; Now, when I echo the code below. It appears in the html as <div id="reply_flash"> </div> // CLOSING THE DIV AND PUTTING THE TABLE OUTSIDE <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td style="font-family: Arial; font-size: 14px; line-height: 19px; text-align: left; color: rgb(102, 102, 102);"> <br> <div style="font-family: Georgia; font-size: 19px; line-height: 20px; color: rgb(88, 43, 0); font-weight: normal; text-align: left;">This is a heading</div> <p>This is some text in this area.</p> <a href="#"><strong>Read more</strong></a> </td> </tr> </table> </div> As you can see, when it's being retrieved and being displayed on the webpage, the div is being closed and the table appears outside it. Have no isdea what is going on. Quote Link to comment https://forums.phpfreaks.com/topic/232385-content-retrieved-from-database-different/ Share on other sites More sharing options...
Adam Posted April 1, 2011 Share Posted April 1, 2011 Does the view loader object pass the HTML through any kind of tidier? Quote Link to comment https://forums.phpfreaks.com/topic/232385-content-retrieved-from-database-different/#findComment-1195474 Share on other sites More sharing options...
Solarpitch Posted April 1, 2011 Author Share Posted April 1, 2011 Nope. Unless Codeigniter automatically does something like that but I dont think so. This has to be something dead simple :-\ Quote Link to comment https://forums.phpfreaks.com/topic/232385-content-retrieved-from-database-different/#findComment-1195522 Share on other sites More sharing options...
Solarpitch Posted April 3, 2011 Author Share Posted April 3, 2011 Hi Guys, Still struggling with this 2 days on. If anyone has any ideas it would be great. Quote Link to comment https://forums.phpfreaks.com/topic/232385-content-retrieved-from-database-different/#findComment-1196271 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.