richie19rich77 Posted November 25, 2006 Share Posted November 25, 2006 Hi EveryoneI can run all these statements one after another and they work fine, but when I put them together I get strage results.lets just say that itemvalue = 11 and partnervalue = 11if ((itemvalue-partnervalue>=2)||(partnervalue-itemvalue>=2)){This statement is Falseif ((itemvalue>10)||(partnervalue>10)){This statement is TrueSo if I put them together:if ((itemvalue-partnervalue>=2)||(partnervalue-itemvalue>=2) && (itemvalue>10)||(partnervalue>10)){This Statement should be False, but it return True ??Just been doing some more testing and if I do:if ((itemvalue-partnervalue>=2)||(partnervalue-itemvalue>=2) == true && (itemvalue>10)||(partnervalue>10) == true){Its still returns Ture statement, but running them by theirselves and they work fine.Any ideas.Thanks Link to comment https://forums.phpfreaks.com/topic/28422-if-statement-problem/ Share on other sites More sharing options...
richie19rich77 Posted November 25, 2006 Author Share Posted November 25, 2006 Sorry coding errorShould be:if (((is_numeric(itemvalue)==true && is_numeric(partnervalue)==true)) && ((itemvalue-partnervalue >1)||(partnervalue-itemvalue >1)) && ((itemvalue >=11)||(partnervalue >=11))) { Link to comment https://forums.phpfreaks.com/topic/28422-if-statement-problem/#findComment-130067 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.