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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:17:03+00:00 2026-06-11T23:17:03+00:00

I am currently making an PHP script which is posting auctions for my marketplace.

  • 0

I am currently making an PHP script which is posting auctions for my marketplace. I use Ajax to post the $_POST variables, including: title, description, price, tags and SupportedOSes. The image as a blob in an external table called ‘temp_images’.

The way I create the auction is by inserting a new auction into ‘MarketDatas’. This is pretty straight forward for the most part. However; when I am trying to insert the BLOB it throws me an error:

You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax near
‘?+Qi}’?m?Am…………’ at line 2

The PHP script for creating auctions looks following:

/*
    .... connect to database, etc!! I will spare you this and skip to the important part:
*/

// Get the posted variables
$title = $_POST["title"];
$descr = $_POST["description"];
$price = $_POST["price"];
$tagsx = $_POST["tags"];
$supOS = $_POST["SupportedOS"];

// Get our session variables
$Authenticated = ($_SESSION["LoggedIn"] == "1" ? true : false);
$User = $_SESSION["User"];
$Username = $_SESSION["username"];

// If we are authenticated, continue!
if ($Authenticated) {
    // Get our temporary image
    $ImgResult = mysql_query("SELECT * FROM temp_images WHERE User='$Username'");
    if (mysql_num_rows($ImgResult) < 1) { die("NoImage"); }

    // Get image blob
    $image = mysql_result($ImgResult, 0, 'Image');

    // Delete image
    if (!mysql_query("DELETE FROM temp_images WHERE User='$Username'")) { die("Error deleting temp image from DB"); }

    // Post auction on market
    if (!mysql_query("INSERT INTO MarketDatas (Description, Price, Tags, Title, SupportedOS, image)
    VALUES ('$descr', '$price', '$tagsx', '$title', '$supOS', '$image')")) { echo "Error posting auction [48]: syntax[" . mysql_error() . "]"; }

}

As you can see, I try to store the BLOB as an string value. But it throws me an error.

How do I solve this?

  • 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-11T23:17:04+00:00Added an answer on June 11, 2026 at 11:17 pm

    Change POST:

    $title = mysql_real_escape_string($_POST["title"]);
    $descr = mysql_real_escape_string($_POST["description"]);
    $price = mysql_real_escape_string($_POST["price"]);
    $tagsx = mysql_real_escape_string($_POST["tags"]);
    $supOS = mysql_real_escape_string($_POST["SupportedOS"]);
    

    AND query:

    mysql_query("INSERT INTO MarketDatas (Description, Price, Tags, Title, SupportedOS, image)
    VALUES ('".$descr."', '".$price."', '".$tagsx."', '".$title."', '".$supOS."', '".mysql_real_escape_string($image)."')")
    

    Most likely your binary data contains ' and breaks your INSERT:

    version for the right syntax near '?+Qi}'?m?Am............'
    ________________________________________^
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to Object Oriented PHP. Currently I am making a login script
I am currently making a php script to graph a bunch of data from
We are currently running an ajax auto complete script through mySQL, as such: <?php
I have a javascript code making an Ajax call to a php script. The
Currently I'm programming a database class which makes a little bit use of PHP's
I'm currently making my own social network and I have a php problem which
I currently have a PHP CLI script using Zend Framework extensively which seems to
I'm currently writing a web application which uses forms and PHP $_POST data (so
I'm currently in the process of finishing a PHP script which parses emails and
I'm currently making a PHP-program that solves equations. I've divided the input equation into

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.