There is a piece of code that does not work.

$email = strval(get_option( 'email_who_paid' )); $amount = get_option( 'amount_paided' ); $period = get_option( 'license_duration' ); $date = strval(date("Ymd")); $wpdb->query("CALL ExtendLicense( $email, $period, $amount, $date )"); $wpdb->query('COMMIT'); 

If you replace the two variables with just the value of the commit occurs

 $email = strval(get_option( 'email_who_paid' )); $amount = get_option( 'amount_paided' ); $period = get_option( 'license_duration' ); $date = strval(date("Ymd")); $wpdb->query("CALL ExtendLicense( 'some@gmail.com', $period, $amount, '2018-02-02' )"); $wpdb->query('COMMIT'); 

What am I doing wrong?

  • What am I doing wrong? Here you substitute $email 'some@gmail.com' instead of $email . Do you have these framing quotes in the variable? - Akina
  • But the variable is of the same string type, they will automatically become. Or not? - Mykola K
  • This is with a fright? Do it humanly - first collect the query text in a variable, then execute it. And in the interim - deduce what you got in the variable to see, and not whether you are trying to perform nonsense. And at the same time - see the status of the request and display error messages, it is very conducive. - Akina
  • Thanks helped) - Mykola K

1 answer 1

$ email = "'". get_option ('email_who_paid')). "'";