开发者

'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);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜