• 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: Donde esta el error?

Donde esta el error? 10 years 8 months ago #28867

  • admin689
  • admin689's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Perdon por el idioma:

Intento rellenar un campo de seleccion con este codigo y no funciona

//<code>
// Prepare the empty array
$items = array();

// Prepare the database connection
$db = JFactory::getDbo();
// Keep this if you'd like a "Please select" option, otherwise comment or remove it
$items[] = "|Seleccionar[c]";

// Run the SQL query and store it in $results -

$db->setQuery("SELECT id, CONCAT(firstname,', ',lastname) AS name FROM liga_joomleague_person INNER JOIN liga_joomleague_team_player ON id=person_id WHERE liga_joomleague_team_player.suspension='1'");
$results = $db->loadObjectList();

// Now, we need to convert the results into a readable RSForm! Pro format.
// The Items field will accept values in this format:
// value-to-be-stored|value-to-be-shown
// Eg. m|M-sized T-shirt
foreach ($results as $result) {
$value = $result->id;
$label = $result->name;
$items[] = $value.'|'.$label;
}

// Multiple values are separated by new lines, so we need to do this now
$items = implode("\n", $items);

// Now we need to return the value to the field
return $items;
//</code>

No devuelve nada... Alguien me puede ayudar????
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!