I have the following method:
public function get_content($page_abbr)
{
$sql = "SELECT language_abbr
, meta_title
, meta_description
, meta_keywords
, page_name
, page_title
, page_content
FROM page_content
WHERE page_name = ?";
$stmt = $this->pdo->prepare($sql);
$stmt->execute(array($page_abbr));
return $stmt->fetch();
}
Then in my page I have the following:
<section id="content">
<h2><?php echo $heading; ?></h2>
<div id="tab-container" class='tab-container'>
<ul class='etabs'>
<li class='tab'><a href="#nl">Dutch</a></li>
<li class='tab'><a href="#en">English</a></li>
</ul>
<div class='panel-container'>
<?php foreach($meta_details as $value): ?>
<div id="<?php echo $value['language_abbr']; ?>">
<h3><span>Titel:</span></h3>
<br>
<?php echo $value['meta_title']; ?>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
But this is giving me the following error
Warning: Illegal string offset ‘language_abbr’ in C:\wamp\www\subdomains\Admin\private\templates\meta_details.php on line 10
What is wrong with this approach?
Thank you in advance!