Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?Php
- function userid($id){
- try{
- include 'dbcon.php';
- $sql = 'SELECT * FROM users where id = :id';
- $s = $pdo->prepare($sql);
- $s->bindValue(':id', $id);
- $s->execute();
- }catch (PDOException $e){
- $error = 'Error fetching id: ' . $e->getMessage();
- include 'error.php';
- exit();
- }
- $id = $s->fetch();
- return $id[0];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement