I try to do SQL request in Joomla V4.0.5. I'm using Postgresql.
My request:
Code: Select all
<?php
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query = ("SELECT * FROM current_weathers");
//$query->select($db->quoteName('temperature'));
//$query->from($db->quoteName('current_weathers'));
$db->setQuery($query);
$result = $db->loadRowList();
print_r($result);
?>
Now I want to make this request in a custom module. I use the plugin Sourcerer v9.1.1 to use php code in my custom module. But when I make that request there, I got only ' 1 ' as result, whatever the request.
Any clue why a php request works in the index.php but no in a custom module ?