There is a constant $donate1 , which ultimately produces STEAM_X:Y:Z , I need to calculate the formula using PHP Z*2+Y=W and send a query with W to the database if it finds the value, it sends the answer from another cell.
(You should at least help with PHP, I'll try to figure it out for MySQL myself)

    1 answer 1

    To begin with, we cut off part of STEAM_ using the $str = substr("STEAM_X:Y:Z", 0, strlen("STEAM_")-1); function $str = substr("STEAM_X:Y:Z", 0, strlen("STEAM_")-1); . Next, create an array of X , Y and Z using the function $arr = explode(":", $str); . Now we will create the formula itself: $W=intval($arr[2])*2+intval($arr[1]); . The intval() function converts a string variable to integer.

    Function documentation:

    1. substr()
    2. strlen()
    3. explode()
    4. intval()
    • one
      In fact, when performing arithmetic operations, the values ​​will be automatically intval , so the intval obviously superfluous. - u_mulder
    • You can use a new case :) - LazyTechwork