• Hello,

    I am receiving the following error between PayPal and my website following processing of a payment. It appears that my cart is sending information to PayPal to process payment however is not able to communicate back:

    Uncaught Error: Call to undefined function mysql_real_escape_string()

    My log file is showing the following fatal error:
    [13-Feb-2018 09:10:24 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /home/vijayandclinton/public_html/wp-content/plugins/gift-registry/php/paypal_response.php:25
    Stack trace:
    #0 /home/vijayandclinton/public_html/wp-content/plugins/gift-registry/gift-registry.php(322): gr_handle_paypal_response()
    #1 /home/vijayandclinton/public_html/wp-includes/class-wp-hook.php(286): GiftRegistry::filterContent(‘<p><!– Automat…’)
    #2 /home/vijayandclinton/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters(‘<p><!– Automat…’, Array)
    #3 /home/vijayandclinton/public_html/wp-includes/post-template.php(240): apply_filters(‘the_content’, ‘<!– Automatica…’)
    #4 /home/vijayandclinton/public_html/wp-content/themes/together/template-parts/content.php(36): the_content(‘Continue readin…’)
    #5 /home/vijayandclinton/public_html/wp-includes/template.php(690): require(‘/home/vijayandc…’)
    #6 /home/vijayandclinton/public_html/wp-includes/template.php(647): load_template(‘/home/vijayandc…’, false)
    #7 /home/vijayandc in /home/vijayandclinton/public_html/wp-content/plugins/gift-registry/php/paypal_response.php on line 25

    PayPal is showing a 404 error.

    Any suggestions or help you can provide would be appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter clintonf

    (@clintonf)

    I have dug deeper and not that the following is on line of paypal_response.php:25

    wp_enqueue_script(‘paypal_response.js’, plugins_url(‘gift-registry/js/paypal_response.js’), array( ‘jquery’ ));
    $customId = mysql_real_escape_string($_GET[‘customId’]);

    One blog I read suggested changing:
    mysql_real_escape_string($_GET[‘customId’]);
    to
    mysqli_real_escape_string($_GET[‘customId’]);

    Which I did and then the PayPal error in ipn was queued however then changed to retrying again….

    Any thoughts?

    Thread Starter clintonf

    (@clintonf)

    My hosting provider is GoDaddy

    Thread Starter clintonf

    (@clintonf)

    Godaddy are recording the following error now:

    [13-Feb-2018 21:13:01 UTC] PHP Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /home/vijayandclinton/public_html/wp-content/plugins/gift-registry/php/paypal_response.php on line 25

    Below is the current code in paypal_response.php: Any thoughts on how to add the second parameter?

    function gr_handle_paypal_response() {
    global $wpdb;

    wp_enqueue_script(‘paypal_response.js’, plugins_url(‘gift-registry/js/paypal_response.js’), array( ‘jquery’ ));
    $customId = mysqli_real_escape_string($_GET[‘customId’]);

    $q = “update {$wpdb->prefix}registry_order set
    status = ‘RECEIVED’
    where id = ‘$customId’ and status != ‘COMPLETED'”;
    $wpdb->query($q);

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Uncaught Error: Call to undefined function mysql_real_escape_string()’ is closed to new replies.