
karimali831
Members-
Posts
436 -
Joined
-
Last visited
Everything posted by karimali831
-
Well with the php validation, it outputs the error and when you hit back, you must re-enter all fields again. I've seen in a few forms where you type in field and when you go to the next field, it outputs the error with a red outline straight away. Is this AJAX? anyone know a website where I can see this?
-
someone please?
-
I don't want my form to allow certain characters such as quotes. Simple way of doing this?
-
Fixed index.php?site=clans¤tpage=$nextpage
-
Ok, my problem is links. The results are displayed like index.php?page=clans and when clicking the nextpage it will be index.php?currentpage=1 or something. How to rectify?
-
Ahh, didn't echo data. Solved.
-
I'm getting something like : : : : : : : : : : [1] 2 3 4 > >> Something wrong with my query? $sql = "SELECT ID, name, clantag, clanhp, leader, clanlogo, password, server FROM ".PREFIX."cup_all_clans WHERE ID LIMIT $offset, $rowsperpage";
-
Can someone show how to setup pagination please? Take a look at attatchment for table structure. Hundreds of these results are being display on the same page causing slow load. [attachment deleted by admin]
-
I was satisfied with my answer? That's how this topic is now resolved.. to you I didn't explain properly, some people have quicker minds than others. I'm just a beginner.
-
So if I wanted to do the same with if(mysql_num_rows($sql_member2)==3) is that if(mysql_num_rows($sql_member2)==$number) or won't it work ?
-
function islocked($clanID) { $ergebnis = safe_query("SELECT * FROM ".PREFIX."settings WHERE cupteamlimit"); while($db = mysql_fetch_array($ergebnis)) { $cupteamlimit = $db['cupteamlimit']; } return (getpenaltypoints($clanID) >= $cupteamlimit); } Ahh fixed Thanks Eagle.
-
Ok.. beginner and I tried but it's wrong function islocked($clanID) { $ergebnis = safe_query("SELECT cupteamlimit FROM ".PREFIX."settings WHERE cupteamlimit = '$cupteamlimit'"); while($db = mysql_fetch_array($ergebnis)) { $cupteamlimit = $db['cupteamlimit']; } return (getpenaltypoints($clanID) >= $cupteamlimit); } am I close?
-
Perfect, just what I needed. Thanks. @ thorpe - if you can't read simple questions best not to say nothing.
-
Yes I did thought about it, why wouldn't I and that's why I'm posting here.
-
Using this code function islocked($clanID) { return (getpenaltypoints($clanID) >= 5); } imposes a ban to a team if they have 5 points or more. I want the value 5 to be set from admin without having to edit this code. So like a textfield in admin where you can input a value and it updates 5 to that value. Any way round this?
-
Yes, that's right but I managed to figure it out elseif($anz_mem+1 <= $ds['typ'])
-
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?
-
elseif($ds['typ'] >= $anz_mem This code is greater than. How do I make it equal or greater?
-
Sorry was meant to say I keep getting the error.
-
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]
-
Ok, now I got : $ergebnis2 = safe_query("SELECT * FROM ".PREFIX."cup_clan_members WHERE userID = '$userID' && clanID = '$clanID'"); if(mysql_num_rows($ergebnis2)==3) echo '<center><b>You already are in 3 teams!</b><br>Please leave a team first.</center>'; elseif(mysql_errno() == 1062) { echo "You're already a member of this clan"; } else{ but still showing sql error and not echo?
-
Ok, I set unique for userID and clanID now you get this error: # Query failed: errorno=1062 # error=Duplicate entry '187-325' for key 2 # query=INSERT INTO ficocup_cup_clan_members (clanID, userID, function) VALUES ('187', '325', 'Member') which is pretty good, but to those that don't understand this error can't the error be changed?
-
As simple as this. Whenever INSERT query fails with mysql_errno returning 1586, you know user tried to add himself to a clan more than once. Ok. Sorry about this but I have never done unique indexing. Perhaps you could tell me how?
-
Yes exackly. The code works if you try and join more than 3 clans, you get error but problem is you can join| the same clan 3 times as you can see from the attatchment. Please say you understand.
-
have I confused anyone? :'(