Hi!
Can the results of a complex sql statement be displayed on the form?
I've tried below to get a very basic sql/php statement to display in an HTML view, but I don't know what PHP to use (I'm finding all kinds of different things in the forum and I'm not sure what's current). I'm working up towards having a drop down selection feed a value into the where section of more complex query, but I figured I'd start with a basic one and then work my way up. Can you get me started please? Let's say I want to get this basic statement to display...
<?php
$db = \JFactory::getDBO();
$query = "
SELECT *
FROM `tbltrainedtopics`;
";
$db->setQuery($query);
$data = $db->loadResult();
print $data;
?>
Can the results of a complex sql statement be displayed on the form?
I've tried below to get a very basic sql/php statement to display in an HTML view, but I don't know what PHP to use (I'm finding all kinds of different things in the forum and I'm not sure what's current). I'm working up towards having a drop down selection feed a value into the where section of more complex query, but I figured I'd start with a basic one and then work my way up. Can you get me started please? Let's say I want to get this basic statement to display...
<?php
$db = \JFactory::getDBO();
$query = "
SELECT *
FROM `tbltrainedtopics`;
";
$db->setQuery($query);
$data = $db->loadResult();
print $data;
?>