Jump to content
  • 0

Update SQL failed


mihaamiharu

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   0
  • Joined:  07/29/19
  • Last Seen:  

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 .@ref$;

.@bonus = (.@amount * .@extra )/ 100;

my sql query :

//

.@b = query_sql("SELECT * FROM `promorefeeral` WHERE `refeeralcode` = '"+escape_sql(.@ref$)+"'",.@refeeral$,.@used,.@extra,.@komisi);

query_sql("UPDATE `promorefeeral` SET `used` = + '1', `komisi` = `komisi` + '"+.@bonus+"' WHERE `refeeralcode` = "+"'+.@refeeral$+'");

 

====

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