Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] petla if problem
Lonas
post
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
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 18.09.2025 - 09:02