Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MySQL]Fatal error: Call to a member function fetch_assoc
Gruchol
post
Post #1





Grupa: Zarejestrowani
Postów: 242
Pomógł: 0
Dołączył: 28.11.2014

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


Witam,
Napisałem prosty system osiągnięć i na xamppie wszystko działało ok, jednak gdy wgrałem to na vpsa gdzie jest nginx i php5-fpm i włączyłem pokazywanie błędów wyskoczył błąd :
Fatal error: Call to a member function fetch_assoc() on a non-object in /usr/share/nginx/www/osiagniecia/osiagniecia.php on line 182

Błąd powtarza się w tych linijkach :
  1. $achivement17 = mysqli_query($db, "SELECT resetwieza FROM user_DATA WHERE user_name='$user_name'");
  2. $achivement18 = $achivement17->fetch_assoc()['resetwieza'];


  1. $achivement19 = mysqli_query($db, "SELECT resetlochy FROM user_DATA WHERE user_name='$user_name'");
  2. $achivement20 = $achivement19->fetch_assoc()['resetlochy'];


  1. $achivement21 = mysqli_query($db, "SELECT lvl FROM user_DATA WHERE user_name='$user_name'");
  2. $achivement22 = $achivement21->fetch_assoc()['lvl'];


Gdzie jest błąd ?
Proszę o pomoc i pozdrawiam.
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: 23.08.2025 - 09:37