Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 08-17-2003, 04:35 AM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 08-17-2003, 11:00 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You just confused me totally. You're trying to join the tables though right?
Reply With Quote
  #3  
Old 08-17-2003, 12:56 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[sql]SELECT *.tablea,*.tableb FROM tablea
LEFT JOIN tableb USING (gameid);[/sql]
Reply With Quote
  #4  
Old 08-17-2003, 04:34 PM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Attached Images
File Type: jpg game_data.jpg (88.5 KB, 0 views)
Reply With Quote
  #5  
Old 08-17-2003, 04:55 PM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And rember these can't be hard coded in thats why I need a code say game_# = #
Attached Images
File Type: jpg game_names.jpg (7.9 KB, 0 views)
Reply With Quote
  #6  
Old 08-17-2003, 06:57 PM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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';
            }
        } 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:33 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04433 seconds
  • Memory Usage 2,241KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (2)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete