Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z średnikiem w klasie
sq6aah
post
Post #1





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 12.10.2009

Ostrzeżenie: (0%)
-----


Własne odpaliłem skrypt:
  1. <?php
  2. require_once('class.Entity.php'); //potrzebne pó_niej
  3. require_once('class.Individual.php');
  4. require_once('class.Organization.php');
  5.  
  6. class DataManager
  7. {
  8. private static function _getConnection() {
  9. static $hDB;
  10.  
  11.  
  12.  
  13. $hDB =new mysqli('localhost', 'xxxxx', 'xxxxx', 'xxxxx');
  14. return $hDB;
  15. }
  16.  
  17. public static function getAddressData($addressID) {
  18. $sql = "SELECT * FROM adres WHERE adres_id ='$addressID'";
  19. $res = $hDB->query($sql);
  20. $num=$res->num_rows;
  21. if($num==0) {
  22. die("Błšd odczytu danych dla adresu pocztowego $addressID");
  23. }
  24.  
  25. return pg_fetch_assoc($res);
  26. }
  27.  
  28. public static function getEmailData($emailID) {
  29.  
  30. $sql = "SELECT * FROM email WHERE email_id = '$emailID'";
  31. $res = $hDB->query($sql);
  32. $num=$res->num_rows;
  33. if($num==0) {
  34. die("Błšd odczytu danych dla adresu email $emailID");
  35. }
  36.  
  37. return pg_fetch_assoc($res);
  38. }
  39.  
  40. public static function getPhoneNumberData($phoneID) {
  41.  
  42. $sql = "SELECT * FROM telefon WHERE telefon_id = '$phoneID";
  43. $res = $hDB->query($sql);
  44. $num=$res->num_rows;
  45. if($num==0) {
  46. die("Błšd odczytu danych dla numeru telefonu $phoneID");
  47. }
  48.  
  49. return $res->fetch_assoc();
  50. }
  51.  
  52.  
  53. public static function getEmployer($individualID) {
  54. $sql = "SELECT organizacja_id\ FROM zatrudniony WHERE osoba_id = '$individualID'";
  55. $res = $hDB->query($sql);
  56. $num=$res->num_rows;
  57. if($num==0) {
  58. die("Błąd odczytu pracodawcy dla osoby $individualID");
  59. }
  60.  
  61. $row = $res->fetch_assoc();
  62.  
  63. if($row) {
  64. return new Organization($row['organizacja_id']);
  65. } else {
  66. return null;
  67. }
  68. }
  69.  
  70. public static function getEmployees($orgID) {
  71. $sql = "SELECT osoba_id FROM zatrudniony WHERE organizacja_id = '$orgID'";
  72. $res = $hDB->query($sql);
  73. $num=$res->num_rows;
  74. if($num==0){
  75. die("Błąd odczytu informacji o zatrudnionych dla organizacji $orgID`");
  76. }
  77. if($num>0) {
  78. $objs = array();
  79. while($row=$res->fetch_assoc()) {
  80. $objs[] = new Individual($row['osoba_id']);
  81. }
  82. return $objs;
  83. }
  84. else {
  85. return array();
  86. }
  87. }
  88.  
  89. ?>


I teraz ciągle dostaje błąd

Parse error: syntax error, unexpected ';', expecting T_FUNCTION in C:\Program Files\WebServ\httpd-users\2php\class.DataManager.php on line 89

I teraz nie wiem co poprawić bo średniki raczej są porządku. Więc co może być nie tak?
Z góry dziękuje za pomoc.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 16.10.2025 - 15:13