MyBB Community Forums

Full Version: displaying custom field based on user logged in...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a field in mybb_userfields called fid4 which is console #.

If I wanted to display that in a textbox for a form, how would I write that?

I have some very ugly code just trying to get a feel for how to do this. I'm not even close to actualy displaying it in the members.php page though.

Here is my code:
<?php
define("IN_MYBB", 1);
require("./global.php");
	$query = $db->query("
		SELECT u.uid, w.wiimail
		FROM mybb_users u
		LEFT JOIN mybb_wiixchange w ON (w.uid=u.uid)
		WHERE w.wiimail='".$db->escape_string($mybb->input['wiimail'])."'
	");
$string = "";
while ($r = $db->fetch_array($query)) {
$string .= $r['wiimail'];
}
echo $string;
?>

As you can see, I am calling 2 tables, joining them and then displaying the results however nothing displays. I would think I would get results that show all users in database whether they have w.wiimail populated or not since there is a LEFT JOIN on the two tables.

See here: http://freemywii.com/forums/wiimail.php - it returns nothing using this code.

Any help?
You do realize that it has to be freemywii.com/forums/wiimail.php?wiimail=<something here> for it to work? <something here> needs to get replaced by whatever is in the database as the row wiimail.
CraKteR Wrote:You do realize that it has to be freemywii.com/forums/wiimail.php?wiimail=<something here> for it to work? <something here> needs to get replaced by whatever is in the database as the row wiimail.

Not sure if I completely understand that or not. I originally had it displaying all of the email addresses delimited with a comma. After revising and wanting to display just one wiimail at a time, it returns to results.

At this point I am grasping at straws to figure out php and will do what I can to learn it...

Any other help is appreciated.