karimali831 Posted February 20, 2010 Share Posted February 20, 2010 function validmembers($clanID, $cupID) { $ergebnis = safe_query("SELECT typ FROM ".PREFIX."cups WHERE ID = '".$cupID."'"); $ds=mysql_fetch_array($ergebnis); $min_anz = strstr($ds['typ']); $ergebnis2 = safe_query("SELECT clanID FROM ".PREFIX."cup_clan_members WHERE clanID = '".$clanID."'"); $anz_mem = mysql_num_rows($ergebnis2); if($anz_mem >= $min_anz) return true; else return $false; } Basically, a team can not signup to a cup if they don't have X (typ) amount of members in their team. typ = 5on5, 4on4 oetc so you need that much members before joining a cup. Screenshots to help you understand. My problem is team can join cup even though they don't have enough members? When typ = 5, still don't work. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/192761-is-this-code-correct/ Share on other sites More sharing options...
karimali831 Posted February 20, 2010 Author Share Posted February 20, 2010 Sorry was meant to say I keep getting the error. Link to comment https://forums.phpfreaks.com/topic/192761-is-this-code-correct/#findComment-1015430 Share on other sites More sharing options...
karimali831 Posted February 21, 2010 Author Share Posted February 21, 2010 elseif($ds['typ'] >= $anz_mem This code is greater than. How do I make it equal or greater? Link to comment https://forums.phpfreaks.com/topic/192761-is-this-code-correct/#findComment-1015444 Share on other sites More sharing options...
karimali831 Posted February 21, 2010 Author Share Posted February 21, 2010 I tried ($anz_mem <= $ds['typ']) But no help.. if I can get $ds['typ'] -1 that would be perfect but not sure how to do this? Link to comment https://forums.phpfreaks.com/topic/192761-is-this-code-correct/#findComment-1015448 Share on other sites More sharing options...
mattwal Posted February 21, 2010 Share Posted February 21, 2010 Hello, I'm not sure if i can help help with the coding problem as I'm only 1 step up from a beginner. But it sounds to me like if you already have your members registered individually (Their own separate accounts) you could then make some sort of page were they can start a clan page; and have their separate account link to that clan. Then (this being about your question) have a battle option where it will set-up a match on a specific day/time and how many players there is going to be 4v4/5v5. In your "Battle" validation script your going to have to perform a check to make sure that there are enough players in each clan. IMO in the battle form your gonna have to carry over both clan id values (i believe) and then you could use that in some sort of sql statement to check on how many player are signed up for the match... I hope this help some. Link to comment https://forums.phpfreaks.com/topic/192761-is-this-code-correct/#findComment-1015452 Share on other sites More sharing options...
karimali831 Posted February 21, 2010 Author Share Posted February 21, 2010 Yes, that's right but I managed to figure it out elseif($anz_mem+1 <= $ds['typ']) Link to comment https://forums.phpfreaks.com/topic/192761-is-this-code-correct/#findComment-1015458 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.