• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Sort Auto-populate a list from a table.

Sort Auto-populate a list from a table. 2 years 11 months ago #41161

  • sintcorp
  • sintcorp's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
I need to sort Arry into the Auto-populate Dropdown a list from a table.

I'm not getting to know how to apply the arsort (array)

Auto-populate a list from a table
www.rsjoomla.com/support/documentation/r...st-from-a-table.html
The administrator has disabled public write access.

Sort Auto-populate a list from a table. 2 years 11 months ago #41162

  • gunerguk
  • gunerguk's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Thank you received: 3
Hi,

This is how I sorted the list where I had a countries dropdown from a table.

Modify your query as this:
$db->setQuery("SELECT your_value, your_label FROM #__your_table" ORDER BY `your_label` ASC");

I hope this helps.
The administrator has disabled public write access.

Sort Auto-populate a list from a table. 2 years 11 months ago #41163

  • sintcorp
  • sintcorp's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 15
Hello gunerguk, problem that I am populating through a webserver.

curl_setopt_array($curl, array(
CURLOPT_URL => "url...,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(....


$response = curl_exec($curl);
$err = curl_error($curl);
$bairro = json_decode($response, true);

foreach ($bairro as $response) {
$value = $response["CodBairro"];
$label = $response["DescBairro"];

$items[] = $value.'|'.$label;
}


$items = implode("\n", $items);
return $items;
curl_close($curl);
Last Edit: 2 years 11 months ago by sintcorp.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!