Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]mysql_num_rows - zła interpretacja warunku
Mody23
post
Post #1





Grupa: Zarejestrowani
Postów: 276
Pomógł: 0
Dołączył: 30.06.2010

Ostrzeżenie: (10%)
X----


Witam!

Dlaczego, tutaj:

  1. if ( $group_approve == '2' && $head_user_id == $id_usera || $group_approve == '2' && $userdata['user_level'] == ADMIN )
  2. {
  3.  
  4. $sql = 'SELECT g.*, c.head_user_id, u.username, u.user_id, u.user_level, u.user_jr
  5. FROM ' . USER_GROUP_COMMUNITY . ' g, '. GROUP_COMMUNITY .' c, '. USERS_TABLE .' u
  6. WHERE u.user_id = g.user_id
  7. AND g.group_community_id = '.$id_grupy.'
  8. AND g.user_approve = 2
  9. GROUP BY u.username';
  10. if ( !($result = $db->sql_query($sql)) )
  11. {
  12. message_die(GENERAL_ERROR, 'jakis error', '', __LINE__, __FILE__, $sql);
  13. }
  14. $countt = mysql_num_rows($result);
  15. while ( $row = $db->sql_fetchrow($result) )
  16. {
  17. $userek_id = $row['user_id'];
  18. $colored_username = color_username($row['user_level'], $row['user_jr'], $row['user_id'], $row['username']);
  19. $row_user_name = $colored_username[0];
  20. $who = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $colored_username[1] . '>' . $row_user_name . '</a>';
  21.  
  22. if ( $countt == '0' )
  23. {
  24. message_die(GENERAL_ERROR, 'Brak użytkowników.');
  25. }
  26. else
  27. {
  28. if ( isset($_POST['accept']) )


warunek if w linii 22 cały czas uznawany jest za niespełniony? Echując zmienną $countt, zwraca mi 0, mimo to, jednak ten warunek jest niespełniany, a powinien być - dlaczego?

Ten post edytował Mody23 1.01.2012, 13:45:30
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: 25.09.2025 - 19:47