Printing Out Accounts w/ x Profile Field
Niki Offline
Junior Member
**
Posts: 29
Joined: Oct 2016
Post: #1
Printing Out Accounts w/ x Profile Field
UPDATED 10/22/2018: New information with where I've gotten thanks to the help of a friend suggesting to use SELECT DISTINCT to print out exact inputs from a field.

What I am attempting to do is create a script that prints out accounts with the input of x profile field. This profile field varies with input and can be edited quite often. So each profile field input is then printed out into its own section like so:

PHP Code:
1
2
3
4
5
6
7
8
9
10
$Candy = $db->query("
    SELECT DISTINCT fid15
    FROM ".TABLE_PREFIX."userfields
    WHERE fid15 != ''
    ORDER BY fid15 ASC
");
while($result=$db->fetch_array($Candy)) {
    $type = $result['fid15'];
	eval("\$CandyList .= \"".$templates->get("candy_entry")."\";");
}


From here I am attempting to then also spit out the accounts in the while/result of $Candy ($CandyList template variable/candy_entry specific field template).

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$Candy = $db->query("
    SELECT DISTINCT fid15
    FROM ".TABLE_PREFIX."userfields
    WHERE fid15 != ''
    ORDER BY fid15 ASC
");
while($result=$db->fetch_array($Candy)) {
    $type = $result['fid15'];
	eval("\$CandyList .= \"".$templates->get("candy_entry")."\";");
	
	$CandyU = $db->query("
        ?????????
    ");
	while($result=$db->fetch_array($CandyU)) {
        $userid = $result['uid'];
        $username = format_name($result['username'], $result['usergroup'], $result['displaygroup']);
        eval("\$CandyUsers .= \"".$templates->get("candy_users")."\";");   
    }
}


However everything I've tried to add in the $CandyU area just does not want to spit out the users with that particular field and quite frankly I'm lost. Help is very much appreciated!

(This post was last modified: 10-23-2018 01:04 PM by Niki.)
01-18-2018 05:37 AM
Find all posts by this user Quote this message in a reply
Niki Offline
Junior Member
**
Posts: 29
Joined: Oct 2016
Post: #2
RE: Printing Out Accounts w/ x Profile Field
Friendly bump + updated to be a bit more 'descriptive' to my best abilities.
09-21-2018 08:06 AM
Find all posts by this user Quote this message in a reply
Niki Offline
Junior Member
**
Posts: 29
Joined: Oct 2016
Post: #3
RE: Printing Out Accounts w/ x Profile Field
Additional friendly bump, updated with new information again and to the extent I have gotten but am now stuck at.
10-23-2018 01:04 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: