Jump to content

[HELP] MSSQL Query, More databases


turkey55

Recommended Posts

I am trying long time to get a auto ban system working for me game, but I fail with it.

me database looks like this

naamloosbi.png

 

What he must do=

he must look in the  "user_bag" under "character"

where wIndex='(some value)'

if he find one, he must look to he's character_no (its a colomn in user_bag)

and remember that character_no

 

when he got the character_no

he must find that character_no in the "user_character" under "character".

and add [GM] on the front of the character_name (colomn in user_character)

 

what I made self (not working :D) is this


set ANSI_NULLS ON 
set QUOTED_IDENTIFIER ON 
go 



/* 
Name: Anti-GM-ITEMS 

Version: Beta V1.0 

*/ 
AS 

DECLARE @character_name varchar(40); 
DECLARE @character_no varchar(50); 


SELECT 
    @character_name    = character_name, 
    @character_no     = character_no 
FROM character.dbo.user_bag 
WHERE 
    wIndex='64988' 
; 

if (@character_name IS NOT NULL) 
BEGIN 

    SELECT FROM character.dbo.user_bag 
    WHERE character_no = @character_no; 

    SELECT @character_name    = character_name 
    FROM account.dbo.user_character 
    WHERE 
        character_no = @character_no; 


END;

Link to comment
https://forums.phpfreaks.com/topic/196228-help-mssql-query-more-databases/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.