Ok, here's the code as it is now,
Code: Select all
<form action="userinfo.php" method="get">
Select a User:
<select name="theusers">
<?php while ($tm_listusers = mysql_fetch_array($tm_users))
{
echo "<option value=\"" . $tm_listusers['user_login'] . "\">" . $tm_listusers['user_login'] . "</option>\n" ;
}
?>
</select>
<input type="submit" value="submit" />
</form>
Code: Select all
<?php
$tm_viewuser = mysql_real_escape_string($_GET[$theusers]);
$tm_vieweduser = mysql_query(" SELECT * FROM wp_usermeta WHERE meta_value='$tm_viewuser' ") or die("Failed: ".mysql_error());
$tm_row = mysql_fetch_array($tm_vieweduser);
echo "<div> " . $tm_row['user_id'] . " </div>";
$first_nameq = mysql_query(" SELECT * FROM wp_usermeta WHERE user_id='$tm_row[user_id]' AND meta_key='first_name' ") or die("Failed: ".mysql_error());
$first_namef = mysql_fetch_array($first_nameq);
echo "<div id=\"textHint\"> " . $first_namef['meta_value'] . " </div>";
?>
Ok superdezign, I'm going to address what you said with the same number for indexing.
1) Some how or nother I got the impression it had to be spaced as it was, but thinking back it makes me go "duh, stupid".
2)I was under the impression that "name" or "id" were used for the string name, then the text between the opening and closing "<option>" was the value, but I guess that's for text areas, but that's a different topic for a different time.
3)makes sense now.
4)Didn't notice...
5)I'm aware it was giving each option the same name. The url after you click the submit button was showing ...usinfo.php?theuser=admin (or whatever the user name is that was selected). But after changing everything to what it is now it shows ...userinfo.php?users=admin so I've learned that it uses the name given to "<selected>"
6)oh...
So I've changed the stuff that needed changing and it's still not working. Something seems to be wrong with the first sql query cause I'm not getting the user_id when I do that query through this method, but if i take that query and give it straight to my sql and switch out the "$tm_vieweduser" with say admin which is my account it returns the proper results... It's probably a typo I'm not seeing but I've been looking at it to long...
Thanks for your help thus far superdezign.