すくすくゴートうちゃんのサーヴァ(黒歴史)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user.mod.php 511 B

1 year ago
1 year ago
1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. class
  3. User
  4. {
  5. var $id;
  6. var $name;
  7. var $pass;
  8. public static function
  9. find (
  10. int $id):
  11. Self
  12. {
  13. $sql = "
  14. SELECT
  15. *
  16. FROM
  17. user
  18. WHERE
  19. id = $id";
  20. $result = $GLOBALS['__db_connection'] -> query ($sql)
  21. or die ("db_select error $sql");
  22. $row = $this -> db -> fetch_array ($result);
  23. $self = new Self;
  24. $self -> id = $id;
  25. $self -> name = $row['name'];
  26. $self -> pass = $row['pass'];
  27. return $self;
  28. }
  29. }