[eluser]paulcj2[/eluser]
I fixed it with:
Code:
$header_data['hm_pg_title'] = array();
$header_data['hm_pg_descrip'] = array();
Now I'm getting:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: hm_pg_text
Filename: views/homepage.php
Line Number: 30
The controller code is:
Code:
//------------------------------------------------------------------------
//get page content
//------------------------------------------------------------------------
$page_data["hm_pg_title"] = array();
$page_data["hm_pg_text"] = array();
$this->load->database();
$sql = "
SELECT
hm_pg_title,
hm_pg_text
FROM
website
WHERE
site_address = '$site_address'";
$rs = $this->db->query($sql);
foreach ($rs->result() as $row) {
$page_data['hm_pg_title'] = $row->hm_pg_title;
$page_data['hm_pg_text'] = $row->hm_pg_text;
}
The views code is:
Code:
//to display home page values
echo "<li>Page title: $hm_pg_title</li>\n";
echo "<li>Site address: $site_address</li>\n";
echo "<li>Text: $hm_pg_text</li>\n"; //line 30
Why would $hm_pg_title work, but not $hm_pg_text?