viewing paste sql | Text

Posted on the
1 2 3 4 5 6 7 8
        if(query_sql("SELECT `claim` FROM `reward_logs` WHERE `code` = '" + escape_sql(.@pc$) + "'",.@claim)) { 
                set .@claim,1;          
                query_sql("UPDATE `reward_logs` SET `claim` = '"+1+"' WHERE `code` = '" + escape_sql(.@pc$) + "'" );
                query_sql("UPDATE `reward_logs` SET `last_ip` = '"+getcharip(strcharinfo(0))+"' WHERE `code` = '" + escape_sql(.@pc$) + "'" );
        }
        else {
                query_sql("INSERT INTO `reward_logs` (`char_id`,`last_ip`,`code`,`redeem_time`,`claim`) VALUES ('"+getcharid(strcharinfo(0))+"','"+getcharip(strcharinfo(0))+"','"+escape_sql(.@pc$)+"',NOW(),'"+1+"')");
                }
Viewed 441 times, submitted by Guest.