Jump to content

INSERT HELP


chriscloyd

Recommended Posts

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
Link to comment
Share on other sites

[!--quoteo(post=353057:date=Mar 8 2006, 11:09 PM:name=chriscloyd)--][div class=\'quotetop\']QUOTE(chriscloyd @ Mar 8 2006, 11:09 PM) [snapback]353057[/snapback][/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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.