Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. function get_user_type($username){
  2.  
  3. $query = mysql_query("SELECT * FROM users WHERE login='$username'");
  4. $row = mysql_fetch_array($query);
  5.  
  6. if(!$row){
  7. return -1;
  8. }
  9.  
  10. if($row['gosc_id'] == 1){
  11. return 0;
  12. }
  13.  
  14. if($row['pracownik_id'] == 1){
  15. return 1;
  16. }
  17.  
  18. if($row['admin_id'] == 1){
  19. return 2;
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement