I am new to Joomla and want to access the #__facileforms_subrecords table from within the article editor and display selective elements.
I have tried the code shown taken from online searches and entered using the CodeMirror editor but it doesn’t recognise it as code.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('*')
->from($db->quoteName('#__facileforms_
//->where($db->quoteName('username') . " = ". $db->quote($user->username));
->where($db->quoteName('name') . " = user_id"));
$db->setQuery($query);
$rows = $db->loadObjectList();
echo '<table>';
echo '<tr>';
echo ' <th>Article Name </th>';
echo ' <th>Report Data </th>';
echo '</tr>';
foreach($rows as $row) {
echo '<tr><td>' . $row->name . '</td><td>' . $row- >report_data . '</td></tr>';
}
echo '</table>';
I hoped to show the entries from the name column in the facileforms_subrecords table containing the word user_id. All I got was the entered code except for the echo’s of Article Name and Report Data. Please note this is an initial test code only to establish something that works so doesn’t represent a finished example. The queries and echo’d headings will be more relevant in the final effort.