Keyword

[SOLVED] retrieve the counter of k2 items, k2 users

  • Giovanni Ciavarelli
  • Giovanni Ciavarelli's Avatar
  • Offline
  • New Member
More
9 years 2 weeks ago #143184 by Giovanni Ciavarelli
Replied by Giovanni Ciavarelli on topic [SOLVED] retrieve the counter of k2 items, k2 users
Hi Krikor,
Unfortunately I did It but It does not work for me. Still Showing Code despite the "result"


Here I prepare custom module
i.imgur.com/PRdq1vt.png

And this is the result, on the right
i.imgur.com/Mq7ZgI5.png

Sorry, I am a noob! :)

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 days ago #143580 by Krikor Boghossian
Replied by Krikor Boghossian on topic [SOLVED] retrieve the counter of k2 items, k2 users
You forgot the <?php ?> brackets for the first part of the code.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Franz Wohlkönig
  • Franz Wohlkönig's Avatar
  • Offline
  • Platinum Member
More
9 years 5 days ago #143585 by Franz Wohlkönig
Replied by Franz Wohlkönig on topic [SOLVED] retrieve the counter of k2 items, k2 users
for non-Devs like me: this works

<?php
$db = JFactory::getDBO();
$query = "SELECT COUNT(*) FROM #__users";
$db->setQuery($query);
$result = $db->loadresult();?>
<?php echo "$result" ?>

Please Log in or Create an account to join the conversation.

  • Giovanni Ciavarelli
  • Giovanni Ciavarelli's Avatar
  • Offline
  • New Member
More
9 years 5 days ago #143592 by Giovanni Ciavarelli
Replied by Giovanni Ciavarelli on topic [SOLVED] retrieve the counter of k2 items, k2 users
Thank you all for helping me!

I changed this line
FROM #__k2_items";

to retrive total number of Items!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 days ago #143594 by Krikor Boghossian
Replied by Krikor Boghossian on topic [SOLVED] retrieve the counter of k2 items, k2 users
Nice to hear that you got it working Giovanni.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum