'mysql_num_rows(): supplied argument is not a valid argument' when trying to use JDatabase
$select = "SELECT * FROM `jos_users`";
$connection->setQuery($select);
$rows = $connection-&开发者_StackOverflow社区gt;getNumRows();
$rows does not work it throws the 'mysql_num_rows(): supplied argument is not a valid' error but...
$result = $connection->loadObjectList();
$result works fine.
Is this a Joomla bug?? Or what am i doing wrong?
<?
$select = "SELECT * FROM `jos_users`";
$connection->setQuery($select);
//add this:
$connection->query();
$rows = $connection->getNumRows();
?>
You're setting the query but not executing it.
would it need to call query()... $res = $db->query('select * from jos_users'); $db->getNumRows($res);
精彩评论