Jump to content


Photo

INSERT HELP


  • Please log in to reply
1 reply to this topic

#1 chriscloyd

chriscloyd
  • Members
  • PipPipPip
  • Advanced Member
  • 489 posts
  • LocationArizona

Posted 08 March 2006 - 11:09 PM

okay i have a tournament script where people and teams can sign up but i need help witht eh joing a team part like when they click on the link join team it shows a drop down list of all the team names and under that drop down theres another input box for a password i want them to enter the team password and if the team password is correct i want it to update the field in the user table under the row of the persons username can some one help me
44 bugs in my java code
44 bugs in my java code
Fix 1 bug, and complie again
122 bugs in my java code

#2 littlened

littlened
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 09 March 2006 - 01:55 PM

[!--quoteo(post=353057:date=Mar 8 2006, 11:09 PM:name=chriscloyd)--][div class=\'quotetop\']QUOTE(chriscloyd @ Mar 8 2006, 11:09 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
okay i have a tournament script where people and teams can sign up but i need help witht eh joing a team part like when they click on the link join team it shows a drop down list of all the team names and under that drop down theres another input box for a password i want them to enter the team password and if the team password is correct i want it to update the field in the user table under the row of the persons username can some one help me
[/quote]

if it was me, I'd query the teams database and get the teamid and the team name, and store them in an array. Then I'd use the array to poplulate a drop down list with the team names.

When the visitor enters a password, it would send the teamid and the password to another page which would do a query to the team table and check the password is correct for that team, if it is, then it would enter the user details into the user table along with the teamid.

for example,

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]
$count;
$sql = "SELECT teamid, teamname FROM teamtable ORDER BY teamname ASC";
$sql_result = mysql_query($sql,$database) or die(mysql_error());
while ($row = mysql_fetch_array($sql_result)) {
$teamid[$count] = $row['teamid'];
$teamname[$count] = $row['teamname];
$count++;
}

// then to create the drop down list you would do

<select name="teams">
<option value=" " Selected> </option>
<?php
$rc = 0;
while ($teamid[$count] <> '') {
echo "<option value='".$teamid[$count]."'>".$teamname[$count]."</option>";
$rc++;
}
?>
</select>

[/quote]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users