• 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: Retrieve categories from a drop-down list

Retrieve categories from a drop-down list 7 years 8 months ago #37294

Hello

I am looking to retrieve the categories to display it in a drop-down list this in order to select a category to save my form in the right category as an article.

In my form I put a drop-down list item that I named "select", I've mapped it to "catid (int unsigned) => {Select: value}"

And I put my script
//<code>
$db = JFactory::getDBO();
$db->setQuery("SELECT `id`, `title` FROM #__categories");
$rez = $db->loadObjectList();
$items = "|Select...\n";
foreach($rez as $r){
	$items .= $r->title."|".$r->id." | ".$r->title."\n";
}
return trim($items);
//</code>

And there is nothing wrong, but the list remains empty !!!!!

Someone could help me please

Thanks dsl for my english but I go through Google translate
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!