Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL]Pobieranie wszytskich pustych rekordów
diamondking
post
Post #1





Grupa: Zarejestrowani
Postów: 100
Pomógł: 0
Dołączył: 7.02.2014

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


Witam - jestem bardzo początkujący (IMG:style_emoticons/default/wink.gif)

Mam w bazie danych tabelę users obecnie składa się z pól:

Jak mam pobrać wszystkie puste pola z tej tabeli i je zliczyć?



Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
diamondking
post
Post #2





Grupa: Zarejestrowani
Postów: 100
Pomógł: 0
Dołączył: 7.02.2014

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


  1. //procent profilu
  2. function procent_profil(){
  3.  
  4. $zapytanie = "SELECT * FROM `users` WHERE `user_id` = 1";
  5. $result = mysql_query($zapytanie);
  6.  
  7. $allFields = count($result)-1;
  8. $filledFields = count(array_filter($results))-1;
  9.  
  10. $filledPercent = $filledFields / $allFields *100;
  11.  
  12. echo $filledPercent;
  13.  
  14. }


BŁĄD:

  1. Warning: array_filter() expects parameter 1 to be array, null given in /home/u416505061/public_html/config.php on line 92 Warning: Division by zero in /home/u416505061/public_html/config.php on line 94 0
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: 7.10.2025 - 01:13