Jump to content
  • 0
mihaamiharu

Update SQL failed

Question

Hi everyone, i have a script to change the value from selected SQL.

The script was running smoothly without error, but the value of SQL column is not changed.

The function of this script is add extra bonus cash point when you entered specific voucher, and accumulated bonus that will given to the voucher owner.

 

My DB Structure

CREATE TABLE `promorefeeral` (
  `refeeralcode` varchar(24) NOT NULL,  // Special Voucher code
  `used` int(11) NOT NULL, // How many times this voucher was used
  `extra` int(11) NOT NULL,  // Total bonus get when used this voucher
  `komisi` int(11) NOT NULL // Acculumated bonus get by the voucher owner
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

 

 

//Used variable on sql query

mes "Please Input your refeeral code";
            input [email protected]$;

[email protected] = ([email protected] * [email protected] )/ 100;

my sql query :

//

[email protected] = query_sql("SELECT * FROM `promorefeeral` WHERE `refeeralcode` = '"+escape_sql([email protected]$)+"'",[email protected]$,[email protected],[email protected],[email protected]);

query_sql("UPDATE `promorefeeral` SET `used` = + '1', `komisi` = `komisi` + '"[email protected]+"' WHERE `refeeralcode` = "+"'[email protected]$+'");

 

====

When i use refeeral on database, the amount of cash point is successfully added.

But the column used, and komisi is not changed.

 

 

 

 

 

 

 

Edited by mihaamiharu
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.