Send cards

Results 1 to 8 of 8
  1. #1
    Apprentice lucasakmeid is offline
    MemberRank
    Jul 2012 Join Date
    Paraguaçu PaulLocation
    9Posts

    Send cards

    Hello , I was wondering if you have any SQL table , I can be sending cards to the players.


  2. #2
    Valued Member top1 is offline
    MemberRank
    Apr 2006 Join Date
    THAILANDLocation
    128Posts

    Re: Send cards

    give me more details

  3. #3
    Apprentice lucasakmeid is offline
    MemberRank
    Jul 2012 Join Date
    Paraguaçu PaulLocation
    9Posts

    Re: Send cards

    Say I wanted to give a player with a card , but I 'm not in the game. And please send by SQL .

  4. #4
    Valued Member top1 is offline
    MemberRank
    Apr 2006 Join Date
    THAILANDLocation
    128Posts

    Re: Send cards

    DECLARE @UID INT
    DECLARE @carD_TYPEID INT
    DECLARE @carD_QTY INT

    SET @UID = 1 -- your uid
    SET @carD_TYPEID = 1 -- card type number
    SET @carD_QTY = 1 -- card quantity to add

    IF EXISTS(SELECT 1 FROM TD_CARD_USRS WHERE UID = @UID AND CARD_TYPEID = @carD_TYPEID) BEGIN
    UPDATE TD_CARD_USRS SET QTY = QTY + @carD_QTY , USE_YN = 'Y' WHERE UID = @UID
    END ELSE BEGIN
    INSERT INTO TD_CARD_USRS(UID,CARD_TYPEID,QTY,USE_YN) VALUES (@UID @carD_TYPEID @carD_QTY,'Y')
    END

  5. #5
    Apprentice lucasakmeid is offline
    MemberRank
    Jul 2012 Join Date
    Paraguaçu PaulLocation
    9Posts

    Re: Send cards

    I could not use the query . More could manually , thank you!

    Error: Msg 102, Level 15, State 1, Line 12
    Incorrect syntax near '@carD_TYPEID'

  6. #6
    Valued Member top1 is offline
    MemberRank
    Apr 2006 Join Date
    THAILANDLocation
    128Posts

    Re: Send cards

    Code:
    DECLARE @UID INT
    DECLARE     @carD_TYPEID INT
    DECLARE     @carD_QTY INT
    
    SET @UID = 1 -- your uid
    SET    @carD_TYPEID = 1 -- card type number
    SET    @carD_QTY = 1 -- card quantity to add
    
    IF EXISTS(SELECT 1 FROM TD_CARD_USRS WHERE UID = @UID AND CARD_TYPEID = #D_TYPEID) BEGIN
    UPDATE TD_CARD_USRS SET QTY = QTY +     @carD_QTY , USE_YN = 'Y' WHERE UID = @UID
    END ELSE BEGIN
    INSERT INTO TD_CARD_USRS(UID,CARD_TYPEID,QTY,USE_YN) VALUES (@UID    @carD_TYPEID,    @carD_QTY,'Y')
    END
    Forums is freak its change my code try to uppercase @carD_TYPEID AND @carD_QTY

    try this link
    Last edited by top1; 10-11-15 at 08:21 AM.

  7. #7
    Apprentice lucasakmeid is offline
    MemberRank
    Jul 2012 Join Date
    Paraguaçu PaulLocation
    9Posts

    Re: Send cards

    Thank you so much!

  8. #8
    Loyalty Vaulient is offline
    MemberRank
    May 2012 Join Date
    MalaysiaLocation
    1,796Posts

    Re: Send cards

    It seems the problem has been solved , I will be closing the thread for now ,if the problem still persists and OP desires the thread to be opened again , please drop me a PM
    Last edited by Vaulient; 15-11-15 at 06:22 PM.



Advertisement