Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class User
- {
- $id = null;
- $username = null;
- $gues = true;
- //vs.. vs..
- __consturct($id= false)
- {
- if($id)
- {
- //sql query ile user bilgilerini cek,
- $this->username = $sqlResult['username'];
- $this->password = //vs vs..
- vs.. vs..
- }
- else if(session dan user id bilgisini al)
- {
- yukardaki ayni islemler.
- }
- else
- {
- $this->id = 0;
- $this->guest = true;
- }
- return $this;
- }
- function getUserByUserName($username)
- {
- //sql query ile user bilgilerini cek,
- $this->username = $sqlResult['username'];
- $this->password = //vs vs..
- return $this;
- }
- function updateUser()
- {
- //update query butun fieldlar bu classin degiskenleri.
- }
- //sonra hangi fonksiyona ihtiyac duyuyosan yaz buraya,
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement