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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.