• 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: Pass a date field entry to an SQL query

Pass a date field entry to an SQL query 3 years 4 months ago #41752

  • sweker
  • sweker's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
Hi,
Using RSForms, I request that users select an Event Date for a timesheet. I would like to then take that selected date and have a list of events populate that match that Event Date, displayed in a drop down list. Is that possible with RSForms?

I am currently using the following following PHP / SQL code to populate the drop down event list, but need to add the parameter that will have only the Events on that date display.

Thank you in advance, Steve

//<code>
$items = "|[c]\n";
$db =& JFactory::getDBO();
$db->setQuery("SELECT DISTINCT title FROM table1 m, table2 r WHERE m.id = r.event_id AND r.begin > '2021-10-01 00:00:00' ORDER BY title");
$result = $db->loadObjectList();

foreach ($result as $r)
$items .= $r->title . "\n";

return $items;
//</code>
Last Edit: 3 years 4 months ago by sweker.
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!