Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]zapytanie w zapytaniu, co jest nie tak
benzulli
post 30.09.2016, 23:26:41
Post #1





Grupa: Zarejestrowani
Postów: 112
Pomógł: 0
Dołączył: 3.07.2013

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


  1. $polaczenie = @new mysqli($host, $db_user, $db_password, $db_name);
  2.             if ($polaczenie->connect_errno!=0)
  3.             {
  4.                 echo "Error: ".$polaczenie->connect_errno;
  5.             }
  6.             else
  7.             {
  8.                 if($rezultat = @$polaczenie->query("SELECT * FROM wp_coins"))
  9.                 while($db_out = $rezultat->fetch_assoc())
  10.                 {
  11.                     if(strtoupper($preg_receiver[1]) == strtoupper($char_name))
  12.                     {
  13.                         if($db_out['tc_id'] !=$preg_id[2])
  14.                         {
  15.                             $polaczenie->query("INSERT INTO wp_coins SET tc_id='$preg_id[2]', coins='$preg_amount[2]', sender='$preg_sender[1]', user='$current_user->user_login', email='$current_user->user_email', used=0");
  16.                         }
  17.                     }
  18.                     if($db_out['email'] == $current_user->user_email && $db_out['coins'] == $preg_amount[2])
  19.                     {
  20.                         $polaczenie->query("UPDATE wp_coins SET used=1 WHERE tc_id='$preg_id[2]'");
  21.                         return true;
  22.                     }
  23.                     else
  24.                         return false;
  25.                 }
  26.             }
  27.             $polaczenie->close();


generuje blad
Error: 1045 Warning: mysqli::close(): Couldn't fetch mysqli
czy moglby ktos wytlumaczyc co jest nie tak?
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 15:07