Jump to content

Content retrieved from Database different


Solarpitch

Recommended Posts

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.