Skip to Content Skip to Menu

simple cb_helloworld SQL question

  • dbusher
  • dbusher
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
17 years 7 months ago #34915 by dbusher
simple cb_helloworld SQL question was created by dbusher
I need to do something that would seem easy. I need to display an SQL query result in a CB Tab. I installed the sample plugin HELLOWOLD and I have tried studying other plugins...I suck.

Can someone tell me how I could modify the HELLOWORLD to include
a simple query and show the results? Or point me to a sample that I can study. Thanks

$sql = "SELECT COUNT(*)
FROM geocaches, logvisit \n".
"WHERE geocaches.cache_id = logvisit.cache_id AND
logvisit.log_owner_id=".$id." AND
geocaches.cache_type = 'Traditional' AND
logvisit.log_type='Found'";

$rsql = mysql_query($sql) or die(mysql_error());

$count = mysql_result($rsql, 0, 0);

echo " <font face='verdana' size='2'><strong><br>
Traditional :".$count."<br>

</strong></font>

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

  • mikko
  • mikko
  • OFFLINE
  • Posts: 703
  • Thanks: 0
  • Karma: 115
17 years 7 months ago #34923 by mikko
Replied by mikko on topic Re:simple cb_helloworld SQL question
In just 30 sec, google gave the answer (hint: joomla database api tutorial)

dev.joomla.org/component/option,com_jd-wiki/Itemid,31/id,tips:using_database_class/


mikko

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

  • dbusher
  • dbusher
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
17 years 7 months ago #34992 by dbusher
Replied by dbusher on topic Re:simple cb_helloworld SQL question
wow..ok thanks!

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

Moderators: beatnantkrileon
Powered by Kunena Forum