2 years 6 months ago - 2 years 6 months ago #6772
by dglazeii
So, I decided to try creating my plugin. It is not working, and not sure why. I am getting the following error. "Object of class Joomla\Database\Mysqli\MysqliDriver could not be converted to string".
The result that I am trying to get is a count of "Yes" Verifications.
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
$db = JFactory::getDbo();
$result = $db->setquery("SELECT COUNT(*) FROM `alabama_cemetery`WHERE `verification`");
{
$output .= $result;
}
This is the SQL command I am trying to run, SELECT COUNT(*) FROM `alabama_cemetery` WHERE `verification` = "Yes"
I did try this, which should give the total count of record but gives me the result of 1
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
$db = JFactory::getDbo();
$result = $db->setquery("SELECT COUNT(*) FROM `alabama_cemetery`");
{
$output .= (int) $result;
}
Last edit: 2 years 6 months ago by dglazeii.
Please Log in to join the conversation.