vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   A messed up problem (https://vborg.vbsupport.ru/showthread.php?t=56266)

SmEdD 08-17-2003 04:35 AM

A messed up problem
 
Ok lets say "game_1" is a column in "tablea"

"tableb" is where the name of the game is. The gameid is 1 and that is how it will find the name of the game.

How do I get game_1 to 1.

Dean C 08-17-2003 11:00 AM

You just confused me totally. You're trying to join the tables though right?

NTLDR 08-17-2003 12:56 PM

[sql]SELECT *.tablea,*.tableb FROM tablea
LEFT JOIN tableb USING (gameid);[/sql]

SmEdD 08-17-2003 04:34 PM

1 Attachment(s)
I also need to get game_ seprated from 1.

It runs like profile feilds. It add game_(id) into the tables where the data goes and not the title and stuff.

I'm trying to say if game_1 get $gameid['1'] or if game_2 get $gameid['2']

Like I said I want game_ droped but the number left behind.

EDIT: Added to pics also trying to help explain.

SmEdD 08-17-2003 04:55 PM

1 Attachment(s)
And rember these can't be hard coded in thats why I need a code say game_# = #

SmEdD 08-17-2003 06:57 PM

Got it after looking at so much stuff trying to figure it out.

PHP Code:

    $games $DB_site->query("
        SELECT *
        FROM clan_game
        ORDER BY displayorder
    "
);
    
    
$gameinfo = array();
    while (
$game $DB_site->fetch_array($games))
    {
        
$varname "game_$game[gameid]";
        
$game['varname'] = $varname;
        
$gameinfo[] = $game;
        
        if (isset(
$_REQUEST["$varname"]))
        {
            
$value = &$_REQUEST["$varname"];
        }
        else
        {
            
$value '';
        }
    } 

PHP Code:

        unset($gamejoin);
        foreach (
$gameinfo AS $index => $value)
        {
            if (
$application["$value[varname]"] == 1)
            {
                
$gamenames $DB_site->query("
                    SELECT *
                    FROM clan_game
                    WHERE gameid = " 
$value['gameid'] . "
                "
);
                
                
$gamename $DB_site->fetch_array($gamenames);
                
$gamejoin .= "" $gamename['game'] . "<br />";
            }
            else
            {
                
$gamejoin '&nbsp';
            }
        } 



All times are GMT. The time now is 11:18 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.00963 seconds
  • Memory Usage 1,729KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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