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 8787365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:52:25+00:00 2026-06-13T21:52:25+00:00

I am trying to get information into my database and am running into a

  • 0

I am trying to get information into my database and am running into a problem that I am sure I am just making a simple mistake. To update the table I am using:

    $conn->query("update webPrice set price= " . $amazonResult['price'] . " where asin = '" . $amazonResult['asin'] . "'");

$conn is my connection. The price is consistently entered as 0. I know there is information there since when I do print_r($amazonResult) I see everything that I want to insert into the DB. Code to get amazon info is:

    foreach($parsed_xml->GetMyPriceForASINResult as $item ) {
 $asin2 =$item->attributes()->ASIN;
$current = $item->Product;

 $status = $item->attributes()->status;

      if (stristr($status, "Success") == true)
{
        $amazonResult = array(
                        'asin' => $asin2,
            'price' => $current->Offers->Offer->BuyingPrice->ListingPrice,//AttributeSets->children('ns2', true)->
                            );

I think the issue is with my update statement, but I an not sure what it is. The asin info is entered correctly. the fields are price = double and asin = varchar.

EDIT: here is the result of print_r($amazonResult);

Array ( [asin] => SimpleXMLElement Object ( [0] => 0176055452 ) [price] => SimpleXMLElement Object ( [CurrencyCode] => USD [Amount] => 10.11 ) )
  • 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-13T21:52:26+00:00Added an answer on June 13, 2026 at 9:52 pm

    Try, adding quotes ' around $amazonResult['price']

    $conn->query("update webPrice set price= '" . $amazonResult['price'] . "' where asin = '" . $amazonResult['asin'] . "'");
    

    Edit: As per your edit, as the values are in objects,

    $conn->query("update webPrice set price= '" . $amazonResult['price']->Amount . "' where asin = '" . $amazonResult['asin']->0 . "'");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to post into a database table, 3 different bits of information,
I am trying to get information from my database and put it into a
I'm trying to get information from a cookie into Alfresco Share. I have a
i have two tables i am trying to get information from. login table -
i'm trying to get Color information that i've stored in a text file and
Hi all I am trying to get contact information from the contact database using
I am trying to get some information from our database and then use it
Hi I am trying to get the nunit results into a database while it
I'm trying to insert information into multiple tables within a database, i have managed
I am trying to gather information into a text file, that I will later

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.