1

I want to store my PHP returned HTML code into a MySQL database. I have manually inserted into database. But when I fetch that data from the database, it is showing an error and the PHP code is not decoding.

For example: $title has value but it shows $title.

The error:

My controller:

$url_data=$this->capcee_news->get_site_details($default_url);
$data['title']=$url_data['vchr_paper_name'];
$data['header']=$url_data['part1'];
$this->load->view('blank',$data);

My model:

public function get_site_details($url='')
{
    if(!empty($url)){
        $this->db->select('*');
        $this->db->from($this->tables['papers']);
        $this->db->join('tbl_template','tbl_news_paper.theme_id=tbl_template.pk_int_temp_id');
        $this->db->where('site_url',$url);
        $data=$this->db->get()->row_array();
        return $data;}
    return false;
}

My view:

echo $header;

Database content:

<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title><?=$title;?></title>
<meta name="description" content="">
6
  • Can you post some sample code? Commented Dec 21, 2017 at 11:50
  • it showing error => post them. Commented Dec 21, 2017 at 21:13
  • Update your question with the model function Commented Dec 21, 2017 at 21:46
  • I have updated my question with model code. please check it @wolfgang1983 Commented Dec 22, 2017 at 4:09
  • Please check attached link which is error showing page Commented Dec 22, 2017 at 4:43

1 Answer 1

3

can you use the actual php tags like

<?php echo $title; ?>

also can you please post more code samples ?

Sign up to request clarification or add additional context in comments.

1 Comment

Yes that’s true first of all you need to use actual php tag

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.