Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function get_single ($select, $from, $where, $what)
- {
- global $pdo;
- $stmt = $pdo->prepare("SELECT ".$select." FROM ".$from." WHERE ".$where." = ?");
- $stmt->execute([$what]);
- $value = $stmt->fetchColumn();
- echo $value;
- }
- get_single('nickname', 'user', 'id', 1);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement