Wordpress guy attempting to help out a client with a Joomla project he's stuck on (favor time basically), and I'm hitting a wall. I believe I'm doing my select correctly, and get no "blank page" errors as a typo would give. Instead, I'm just getting an empty array. No results returned, but I believe there to be.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('id', 'video_title')));
$query->from($db->quoteName('#__films_videos'));
$db->setQuery($query);
$results = $db->loadObjectList();
if($results) {
print_r($results);
}else{
echo '<pre>Oops! No results :(</pre>';
}
I'm rather new to Joomla, but I understand databases pretty well after 14 years of custom web development & Wordpress experience. Just not sure where I'm tripping up. Any ideas? I keep triggering the else
.
films_videos
is indeed the name of our module, and no Joomla errors present themselves in the output of a page load.
#__films_videos
contains any data? – Dmitry Rekun Nov 21 '14 at 8:27$query->dump();die;
right before executing it and see what the SQL actually is, then run that myself in MySQL to see syntax/results/errors....a little brute force, but might do the trick – GDP Nov 21 '14 at 14:39