Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Trying to get property of non-object [problem]
thoran
post
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 11.07.2005

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


Wrzucilem skrypty na serwer z obsługa php 5 i wywala mi takiego notice "Trying to get property of non-object in". Co to oznacza i jak się tego pozbyć?

Ten post edytował thoran 9.11.2005, 17:31:38
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
thoran
post
Post #2





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 11.07.2005

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


  1. <?php
  2.  
  3. if ($player -> race == 'Tauren')
  4.  
  5. {
  6.  
  7. $ap = ($ap + 6);
  8.  
  9. }
  10.  
  11. else
  12.  
  13. {
  14.  
  15. $ap = ($ap + 5);
  16.  
  17. }
  18.  
  19. ?>


bład pojawia się w 3 linijce, kod ten znajduje się w funkcji której poczatek wygląda tak

  1. <?php
  2.  
  3. function checkexp ($exp,$expgain,$level,$rasa,$user,$eid,$enemyid,$enemyuser,$player,$skill,$amount)
  4.  
  5. {
  6.  
  7. global $db, $newdate;
  8.  
  9.  
  10.  
  11. $poziom = 0;
  12.  
  13. $ap = 0;
  14.  
  15. $pz = 0;
  16.  
  17. $energia = 0;
  18.  
  19. $texp = ($exp + $expgain);
  20.  
  21. if ($level < 100)
  22.  
  23. {
  24.  
  25. $expn = ($level * $level) * 100;
  26.  
  27. }
  28.  
  29. if ($level > 99 && $level < 200)
  30.  
  31. {
  32.  
  33. $expn = ($level * $level) * 250;
  34.  
  35. }
  36.  
  37. if ($level > 199 && $level < 300)
  38.  
  39. {
  40.  
  41. $expn = ($level * $level) * 500;
  42.  
  43. }
  44.  
  45. if ($level > 299 && $level < 400)
  46.  
  47. {
  48.  
  49. $expn = (pow($level,2) * 1000);
  50.  
  51. }
  52.  
  53. if ($level > 399 && $level < 500)
  54.  
  55. {
  56.  
  57. $expn = (pow($level,2) * 2500);
  58.  
  59. }
  60.  
  61. if ($level > 499 && $level < 600)
  62.  
  63. {
  64.  
  65. $expn = (pow($level,2) * 5000);
  66.  
  67. }
  68.  
  69. if ($level > 599 && $level < 700)
  70.  
  71. {
  72.  
  73. $expn = (pow($level,2) * 10000);
  74.  
  75. }
  76.  
  77. if ($level > 699 && $level < 800)
  78.  
  79. {
  80.  
  81. $expn = (pow($level,2) * 25000);
  82.  
  83. }
  84.  
  85. if ($level > 799 && $level < 900)
  86.  
  87. {
  88.  
  89. $expn = (pow($level,2) * 50000);
  90.  
  91. }
  92.  
  93. if ($level > 899 && $level < 1000)
  94.  
  95. {
  96.  
  97. $expn = (pow($level,2) * 100000);
  98.  
  99. }
  100.  
  101. $energy = $db -> Execute("select max_energy from players where id=".$eid);
  102.  
  103. while ($texp >= $expn)
  104.  
  105. {
  106.  
  107. $poziom = ($poziom + 1);
  108.  
  109. if ($player -> race == 'Tauren')
  110.  
  111. {
  112.  
  113. $ap = ($ap + 6);
  114.  
  115. }
  116.  
  117. else
  118.  
  119. {
  120.  
  121. $ap = ($ap + 5);
  122.  
  123. }
  124.  
  125. $texp = ($texp - $expn);
  126.  
  127. $level = ($level + 1);
  128.  
  129. if ($level < 100)
  130.  
  131. {
  132.  
  133. $expn = (pow($level,2) * 100);
  134.  
  135. }
  136.  
  137. ?>


Na php 5 jeszcze nie mialem okazji pracowac dlatego nie wiem co z tym zrobić.



Wlasnie zauwazylem ze wyskakuje to w linijkach w których uzywam isset lub empty

  1. <?php
  2. if (isset($arrows -> fields['id'])) //tutaj
  3. {
  4. $test = $db -> Execute("SELECT id FROM equipment WHERE name='".$arrows -> fields['name']."' AND status='U' AND owner=".$player -> id);
  5. }
  6. if (empty ($test -> fields['id'])) //tutaj
  7. {
  8. $db -> Execute("UPDATE equipment SET status='U' WHERE type='R' AND owner=".$player -> id." AND status='E'");
  9. } 
  10. else 
  11. {
  12. $db -> Execute("UPDATE equipment SET wt=wt+".$arrows -> fields['wt']." WHERE id=".$test -> fields['id']);
  13. $db -> Execute("DELETE FROM equipment WHERE id=".$arrows -> fields['id']);
  14. }
  15. if (isset($test -> fields['id'])) //tutaj
  16. {
  17. $test -> Close();
  18. }
  19.  
  20. ?>


Ten post edytował thoran 8.11.2005, 22:31:20
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: 9.10.2025 - 22:50