Jump to content
  • 0

help cashcode update table sql


Slammer

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  218
  • Reputation:   152
  • Joined:  11/28/11
  • Last Seen:  

harboro1,77,245,3    script    Voucher    878,{
    mes @name$;
    mes "Service premium ID";
    next;
    menu "Input Code Voucher",L_ICV,"Change my Mind",L_end;

L_ICV:
            mes "Input your code";            
            input @donate_code$;
            next;        
            query_sql "SELECT `code` FROM `cashcode` WHERE `code` = '"+@donate_code$+"'", @donation_code$;
            query_sql "SELECT `status` FROM `cashcode` WHERE `code` = '"+@donate_code$+"'", @donate_status;
            if(strtoupper(@donate_code$)==@donation_code$ && @donate_status == 0)
            {
                query_sql "SELECT `cash` FROM `cashcode` WHERE `code` = '"+@donate_code$+"'", .@donation_code$;
                atcommand "@cash +"+.@donation_code$+"";
                mes "You gained ^0000FF" + .@donation_code$ + "^000000 Cash Point.";
                mes "Total Cash : ^0000FF"+#CASHPOINTS+"^000000 Cash Point";
                query_sql "UPDATE `cashcode` SET `status`=1 WHERE `code`='"+@donate_code$+"'";
                query_sql "UPDATE `cashcode` SET `userid`=(SELECT `userid` FROM `login` WHERE `code`='"+@donate_code$+"')";
                close2;
                end;                
                }
            if(strtoupper(@donate_code$)==@donation_code$ && @donate_status == 1)
            {
                mes "Code already used.";
                close;
            }
            else
            {
                mes "Code unregister.";
                close;
            }
L_end:
            mes "if you change of mind back again";    
close;

}



anybody help me. i want take userid from table login to table cashcode.

code i make is wrong. ?

Edited by Patskie
code
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   25
  • Joined:  12/24/14
  • Last Seen:  

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...