I'm trying to pull the pages from my database and make them an actual page url:
http://i.imgur.com/r5AuaKB.png
$stmt = $auth_user->runQuery("SELECT * FROM pages");
$stmt->execute();
$menu = $stmt->fetch(PDO::FETCH_ASSOC);
foreach($menu as $page) {
if(basename($_SERVER['REQUEST_URI']) == $page['slug']){
require_once('inc/page/' . $page['slug'] . '.php');
}
}
But for some reason it doesn't work. I keep getting this
Illegal string offset 'slug'
error. How do I resolve this?