emma57573 Posted July 2, 2008 Share Posted July 2, 2008 Im trying to say if 'worldwide' is selected as yes AND the country DOESNT match the word "UK". The first part works but the $country bit goes wrong so somethings not quite right. Im not getting any errors its just simply not working. if (($rst["worldwide"]=="yes")&&(($country=="UK") = "false")){ It would be great f someone could point out what Im doing wrong here. Thank you in advance Link to comment https://forums.phpfreaks.com/topic/112978-solved-simple-syntax-error/ Share on other sites More sharing options...
DarkWater Posted July 2, 2008 Share Posted July 2, 2008 Try: if (($rst["worldwide"]=="yes")&&($country!="UK")){ You had a single = which meant you were trying to assign false to ($country == "UK") which makes no sense. Link to comment https://forums.phpfreaks.com/topic/112978-solved-simple-syntax-error/#findComment-580324 Share on other sites More sharing options...
rhodesa Posted July 2, 2008 Share Posted July 2, 2008 if ($rst["worldwide"]=="yes"&&$country!="UK"){ ...beat me too it...you can remove the extra parenthesis too... Link to comment https://forums.phpfreaks.com/topic/112978-solved-simple-syntax-error/#findComment-580325 Share on other sites More sharing options...
emma57573 Posted July 2, 2008 Author Share Posted July 2, 2008 Thats great thanks for that. Im kind of learning as I go along! Link to comment https://forums.phpfreaks.com/topic/112978-solved-simple-syntax-error/#findComment-580329 Share on other sites More sharing options...
DarkWater Posted July 2, 2008 Share Posted July 2, 2008 Any time. =) @rhodesa: Doesn't really matter, if the person wants to visually separate the logic, let them. =P Link to comment https://forums.phpfreaks.com/topic/112978-solved-simple-syntax-error/#findComment-580334 Share on other sites More sharing options...
rhodesa Posted July 2, 2008 Share Posted July 2, 2008 Any time. =) @rhodesa: Doesn't really matter, if the person wants to visually separate the logic, let them. =P agreed...hence the word 'can' instead of 'should' Link to comment https://forums.phpfreaks.com/topic/112978-solved-simple-syntax-error/#findComment-580336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.