Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User
- {
- private $conn;
- private $db;
- private $u;
- private $conre;
- function __construct($conn, $db, $u, $conre) {
- $this->conn = $conn;
- $this->db = $db;
- $this->u = $u;
- $this->conre = $conre;
- }
- function getUserNameByID($id)
- {
- $query = $conn->prepare('SELECT '.$u['name'].' FROM '.$tb['user'].' WHERE '.$u['id'].' = :id ');
- $query->execute(array(
- ':id' => $id
- ));
- $result = $query->fetchAll();
- if ( count($result) ){
- $name = "ERROR - user class, function getUserNameByID, line 25, last-change: 14.07.2013";
- foreach($result as $row1)
- {
- $name = $row1[$u['name']];
- }
- }
- return $name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement