- Posts: 9
COMMUNITY FORUM
[SOLVED] retrieve the counter of k2 items, k2 users
- Giovanni Ciavarelli
- Offline
- New Member
Less
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! :)
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
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 5 days ago #143580
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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
- Offline
- Platinum Member
Less
More
- Posts: 529
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" ?>
<?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
- Offline
- New Member
Less
More
- Posts: 9
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
to retrive total number of Items!
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
- Offline
- Platinum Member
Less
More
- Posts: 15920
9 years 5 days ago #143594
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
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.