Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8004045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:48:54+00:00 2026-06-04T16:48:54+00:00

I am trying to integrate amazon api into my website, so far I have

  • 0

I am trying to integrate amazon api into my website, so far I have managed to have it navigate to the correct xml part and store that as an variable however i am now trying to insert this varibable into my mysql database and it is giving me this error

Notice: Undefined variable: sql_select in
Fatal error: Call to a member function query() on a non-object

what am i doing wrong?

Entire Code

define('INCLUDED', 1);
error_reporting(E_ALL); 
ini_set("display_errors", 1); 
$AWS_ACCESS_KEY_ID = "HIDDENFORPRIVACY";
$AWS_SECRET_ACCESS_KEY = "HIDDENFORPRIVACY";

$base_url = "http://free.apisigning.com/onca/xml?";
$url_params = array('Operation'=>"ItemLookup",'Service'=>"AWSECommerceService",
 'AWSAccessKeyId'=>$AWS_ACCESS_KEY_ID,'AssociateTag'=>"HIDDENFORPRIVACY",
 'Version'=>"2011-08-01",'Availability'=>"Available",'ItemId'=>"0273702440",
 'ItemPage'=>"1",'ResponseGroup'=>"EditorialReview", 'Title'=>"Accounting and Finance for Non-Specialists 5th Edition");

// Add the Timestamp
$url_params['Timestamp'] = gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time());

// Sort the URL parameters
$url_parts = array();
foreach(array_keys($url_params) as $key)
    $url_parts[] = $key."=".$url_params[$key];
sort($url_parts);

// Construct the string to sign
//$string_to_sign = "GET\nhttp://free.apisigning.com/".implode("&",$url_parts);
//$string_to_sign = str_replace('+','%20',$string_to_sign);
//$string_to_sign = str_replace(':','%3A',$string_to_sign);
//$string_to_sign = str_replace(';',urlencode(';'),$string_to_sign);

// Sign the request
//$signature = hash_hmac("sha256",$string_to_sign,$AWS_SECRET_ACCESS_KEY,TRUE);

// Base64 encode the signature and make it URL safe
//$signature = base64_encode($signature);
//$signature = str_replace('+','%2B',$signature);
//$signature = str_replace('=','%3D',$signature);
//$signature = str_replace(';',urlencode(';'),$string_to_sign);
$url_string = implode("&",$url_parts);
$url = $base_url.$url_string;
//print $url;


$ch = curl_init();                   //this part we set up curl 
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$xml_response = curl_exec($ch);
curl_close($ch);
header('Content-type: application/xml');  //specify as xml to not display as one long string
echo $xml_response; 

$xml = new SimpleXMLElement($xml_response);  //time to echo back the correct piece of data

$editorialReview = $xml->Items->Item->EditorialReviews->EditorialReview->Content;

$variable = '<p>Editorial review: '.html_entity_decode($editorialReview).'</p>'."\n";
echo $variable;

$sql_select = mysql_query("INSERT INTO " . DB_PREFIX . "auctions
            (amazon_description) VALUES
            ('" . $variable . "')");
            echo ($sql_select);

this does not send errors, but the mysql database shows no change

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:48:55+00:00Added an answer on June 4, 2026 at 4:48 pm

    The error “Undefined variable” indicates that you have not initialized the object.

    From the code you printed it seems that $sql_select should be a string which has the select statement.

    So you need to do something like :

    $variable = '<p>Editorial review: '.html_entity_decode($editorialReview).'</p>'."\n";
    echo $variable;
    
    $sql_select .= "INSERT INTO " . DB_PREFIX . "auctions
                (amazon_description) VALUES
                ('" . $variable . "')";
    
    $DB_object->query($sql_select);
    

    Please post the entire code so that the solution can be accurately found out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to integrate Amazon Product API into my website and came across several
I am trying to integrate NHibernate.Search into a multi-lingual website. Now, this website contains
I am trying to Integrate an SMS service into my website. I need to
While trying to integrate Yahoo Media Player into my own website, I want to
I am trying to integrate some OpenCV functionality into my application. Currently I have
I am trying to integrate yelp into a website I'm working on. I'm really
I am trying to integrate NCover 2 into TeamCity 5.0.1, and since I have
I am trying to integrate Facebook into my app and have already implemented MGTwitterEngine
I am trying to integrate Paypal Express checkout into my website. Everything worked fine
I am trying to integrate a Hibernate application into a proprietary framework. My problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.