vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Selecting data from SQL tables. (https://vborg.vbsupport.ru/showthread.php?t=68186)

TosaInu 08-10-2004 11:17 AM

Selecting data from SQL tables.
 
Hello,

What's the syntax to get data from a table by using data from another? It's done in PERL and it always confused me there, using ->{' '} ->{''}

Example editing the postbit template:

<div>$vbphrase[usergroup]: $post[usergroupid]</div>

But I want to display the title for the group, not the ID. It collected data from table users and now information from table usergroups is required.

<div>$vbphrase[usergroup]: $post[usergroupid->[title]]</div> does not work. What's the correct syntax?

TosaInu 08-18-2004 05:56 PM

Hello,

Isn't this the right forum to ask or is it not clear what I asked?

TosaInu 08-31-2004 02:48 PM

What I asked for appears to be a default setting: user ranks. I would however like to know how to get data from table usergroups for a given member. Do you need to make a query? How? Example please.

rake 08-31-2004 03:16 PM

Your understanding of queries and variables in php is a bit shaky. The data you want is already there ($post[displaygrouptitle]), but if it weren't you'd have to edit a query in the showthread.php file to obtain it. While vb's templating system is powerful, you can't query the database through it. I hope it was helpful :)


All times are GMT. The time now is 12:53 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00944 seconds
  • Memory Usage 1,706KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete