Trouble about to get results

11 years 6 months ago - 11 years 6 months ago #213092 by thiagocs
Trouble about to get results was created by thiagocs
Hi

Well, i have this code to get the users in my DB. My programmer is on vacation and would like to know if anyone can help me get the result table X in other registration program.
//<code>
$items = "|Please Select\n";
$db =&JFactory::getDBO();
$db->setQuery("SELECT DISTINCT(users) FROM #__users");
$result = $db->loadResultArray();
for($i=0;$i< count($result);$i++)
{
$items .= $result[$i].'|'.$result[$i];
if($i<count($result)-1){
$items .= "\n";
}
}
//echo $items;
return $items;

//</code>

I need to get data from a table that has the record of the Company's subsidiaries.
So I just wanted an example of how the code would be, example:

("SELECT DISTINCT (TableX?)

Please Log in to join the conversation.

11 years 6 months ago - 11 years 6 months ago #213137 by krileon
Replied by krileon on topic Re: Trouble about to get results
You already have an example in your above code (we can't be specific in this regard as we don't know your table structure or database), what is it you're wanting to do more specifically? Display the results of a query on a users profile? Update a table with a users profile data? Or just an example select query?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.175 seconds

Facebook Twitter LinkedIn