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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:00:57+00:00 2026-05-20T00:00:57+00:00

i retrieve data from upc database and then want to insert the data into

  • 0

i retrieve data from upc database and then want to insert the data into my own data base all the code is correct but when i check my database there is no record in my database table my code is

if(!$resp->faultCode())
    {
        //Store the value of the response in a variable
        $val = $resp->value();
        //Decode the value, into an array.
        $data = XML_RPC_decode($val);
        //Optionally print the array to the screen to inspect the values
               echo $upc=$data['upc'];
               echo $ean=$data['ean'];
               echo $description=$data['description'];
               echo $size=$data['size'];
                $query1="INSERT INTO upc(upc,ean,description,size) values('$upc','$ean','$description','$size')";
                var_dump($query1);
                $result1=mysql_query($query1);

Note that i echoed all the variables and the result is shown like this

639382000393
0639382000393
The Teenager's Guide to the Real World by BYG Publishing
book
string(166) "INSERT INTO upc(upc,ean,description,size) values('639382000393
','0639382000393
','The Teenager's Guide to the Real World by BYG Publishing
','book
')" You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Guide to the Real World by BYG Publishing
','book
')' at line 1

but no data is inserted in my table

  • 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-05-20T00:00:58+00:00Added an answer on May 20, 2026 at 12:00 am

    The data includes a ' character and, instead of using bound variables, you are just mashing strings together to create your query. Since you use ' to delimit strings, the SQL breaks. This also means you are vulnerable to SQL Injection attacks.

    Use bound variables.

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

Sidebar

Related Questions

I have code to retrieve data from a database into a form but it
Iam trying to retrieve data from mysql database into stylesheet.php but it is not
I need to retrieve data from several rows and then insert the results into
I want to retrieve data from Oracle Data Base which has SID, Port, Host
I want to retrieve data from the database. The number of data is fixed
I want to retrieve data from core data (sqlite database) according to primary key.
inHow do i retrieve data from sqlite database from adapter class and insert to
Here is a sample code to retrieve data from a database using the yield
I use the next code to retrieve data from a table in the database:
I retrieve data from a mysql database. I want to make this data available

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.