stencilz Posted February 12, 2007 Report Share Posted February 12, 2007 if($count_2 == "0" && $who['win2'] == "") { mysql_query("UPDATE table SET win2='no' WHERE user='".$id."'"); } else if($count_2 > "0" && $who['win2'] == "") { mysql_query("UPDATE table SET win2='yes' WHERE user='".$id."'"); } $count_2 ir nulle, taču tabulā ievietojas yes, kā tas ir iespējams? man domāt ka tas ir saistīts ar else, vai tā ir? Link to comment Share on other sites More sharing options...
bubu Posted February 12, 2007 Report Share Posted February 12, 2007 Tas nav iespējams. Tu kautko jauc. Link to comment Share on other sites More sharing options...
andrisp Posted February 12, 2007 Report Share Posted February 12, 2007 stencilz, tieši pirms if uztaisi var_dump($count_2); Link to comment Share on other sites More sharing options...
stencilz Posted February 12, 2007 Author Report Share Posted February 12, 2007 (edited) man parāda int(0) ja else noņem nost tad viss ir kārtībā, tā vispār var darīt - else if? it kā vienā tutoriālī tā bija.. un kāda vispār atšķirība starp else if un elseif? Edited February 12, 2007 by stencilz Link to comment Share on other sites More sharing options...
Grey_Wolf Posted February 12, 2007 Report Share Posted February 12, 2007 un kāda vispār atšķirība starp else if un elseif? nekaada ;) ja neskaita pierakstaa .... Un dariit var un dazreiz pat ieteicamaak nekaa svitch konstrukcija (ja ir dazaadi nosacijumi) Link to comment Share on other sites More sharing options...
andrisp Posted February 12, 2007 Report Share Posted February 12, 2007 Nav atšķirības. Luku precīzi tāds pats kods (no loģikas viedokļa) kā tavs. Ko tev rāda? <?php $x = 0; if ($x == "0") { echo '1'; } else if ($x > "0") { echo '2'; } ?> Link to comment Share on other sites More sharing options...
bubu Posted February 12, 2007 Report Share Posted February 12, 2007 Kāda jēga salīdzināt integeru ar stringu, stencilz? Link to comment Share on other sites More sharing options...
stencilz Posted February 13, 2007 Author Report Share Posted February 13, 2007 es nesaprotu ko tu ar to gribi pateikt? Link to comment Share on other sites More sharing options...
andrisp Posted February 13, 2007 Report Share Posted February 13, 2007 0 ir integers, "0" ir strings. http://lv2.php.net/manual/en/language.types.php Link to comment Share on other sites More sharing options...
stencilz Posted February 13, 2007 Author Report Share Posted February 13, 2007 mla, un es visur darīju šādi Link to comment Share on other sites More sharing options...
Stopp Posted February 13, 2007 Report Share Posted February 13, 2007 Nu labi, kamēr ir ==, tikmēr tas lietas būtību nemaina un tavs dotais koda piemērs nevar darīt to, ko tu saki, ka viņš dara. Link to comment Share on other sites More sharing options...
stencilz Posted February 15, 2007 Author Report Share Posted February 15, 2007 jā taisnība jums vien ir, kļūda bija citur Link to comment Share on other sites More sharing options...
Recommended Posts