Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] petla if problem
Lonas
post 10.03.2006, 11:38:49
Post #1





Grupa: Zarejestrowani
Postów: 576
Pomógł: 14
Dołączył: 9.11.2005

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


Dlaczego przy takim kodzie
  1. <?php
  2. if( $dzial != NULL && $gama !==NULL ) {
  3. $sqlwhere .= " `dzial` = '$dzial'";
  4. }
  5.  
  6. if( $dzial !== NULL && $gama !=NULL ) {
  7. $sqlwhere .= "`gama` = '$gama' ";
  8.  
  9. }
  10. if( $dzial != NULL && $gama !=NULL ) {
  11. $sqlwhere .= " `dzial` = '$dzial' and `gama` = '$gama' ";
  12. }
  13.  
  14.  
  15. if($sortuj != NULL) {
  16. $sqlwhere .= " order by '$sortuj' desc";
  17. }
  18.  
  19. if($sortuj !== NULL) {
  20. $sqlwhere .= " ";
  21. }
  22. ?>


zaznaczajac naraz i game i dzial otrzymuje taki wynik

where `dzial` = '2'`gama` = 'A' `dzial` = '2' and `gama` = 'A'

Ten post edytował L.Pociask 10.03.2006, 11:42:09


--------------------
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: 19.07.2025 - 05:12