Advertisement
Redee

scetch > func_content.php

Jun 17th, 2013
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. <?
  2. function Content($menu)
  3. {
  4.     global $con;
  5.     $sql = "SELECT name, content FROM menu WHERE name = '$menu'";
  6.  
  7.     $stmt = $con->prepare($sql); // PDOStatement
  8.     $stmt->execute();
  9.     $res = $stmt->fetch(PDO::FETCH_ASSOC);
  10.     $GLOBALS['content_from_menu'] = nl2br($res['content']);
  11. }
  12. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement