2018-09-20, 09:51 PM
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:
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).
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!
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:
$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).
$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!