Jump to content
MakeWebGames

How would I...?


Recommended Posts

What you will want to do first is run a query (if not already done) to see what users are in their clan:

 

$res = $db->query("SELECT * FROM `users` WHERE `gang` = '".$ir['gang']."'");

 

OR, if you do not have the current user's clan saved in a variable or in a class:

 

 $res = $db->query("SELECT * FROM `users` WHERE `gang` = (SELECT `gang` FROM `users` WHERE `id` = '".$ir['userid']."')");

 

Then, once you have that information, you can then create a loop like this:

 

echo "<select name='vpdropdown'>";
echo "<option value='0'>None Selected</option>";
while ($qres = $db->fetch_row($res))
{
   echo "<option value='".$qres['userid']."'>".$qres['username']."</option>";
}
echo "</select>";

Then, once you have that, all you would have to do to find the value is to do is get the value of the "vpdropdown" using $_GET or $_POST as well as check to make sure that the value is not zero.

I would also run a check (if not done already) to verify that the ID of the user given is in fact in the clan.

Hopefully all of that makes sense haha. If you have any questions, let me know or post here so others may answer.

~G7470

Edited by G7470
Link to comment
Share on other sites

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.   Paste as plain text instead

  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...