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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:40:59+00:00 2026-06-03T11:40:59+00:00

I’m having a problem while sending a query and it’s driving me a bit

  • 0

I’m having a problem while sending a query and it’s driving me a bit insane, here’s what I’m talking about:

 $query = "INSERT INTO combined(v_products_model, v_products_image, v_products_description_1, v_products_name_1, v_products_quantity, v_tax_class_title, v_status, EOREOR) " .
            "VALUES ('$fileName', '$fileName', '$description', '$description', '10', '--none--', 'Active', 'EOREOR')";
    mysql_real_escape_string($fileName);
    mysql_real_escape_string($description);
    $queryResult = mysql_query($query, $connect);
//  die(var_dump($queryResult));

if (!$queryResult) {
    die("Error with query: line 40 <br>
                 Query: $query <br>
                 Error: " . mysql_error());
}

For some reason the if statement always runs, I’ve tried putting $queryResult == false as the argument as well but it’s the same result.

I know $queryResult is not false because I ran a die() statement on it and it returned ‘1’, I also ran var_dump and it returned ‘boolean true’.

mysql_error() never returns any result. If anyone could tell me why the block is running I’d appreciate it.

Here’s what is actually printed, and by the way it’s not escaping the query either:

Error with query: line 40 
Query: INSERT INTO combined(v_products_model, v_products_image, v_products_description_1, v_products_name_1, v_products_quantity, v_tax_class_title, v_status, EOREOR) VALUES ('ts_aiw_wereall.jpg', 'ts_aiw_wereall.jpg', 'ALICE IN WONDERLAND we're a sk PUR TS S', 'ALICE IN WONDERLAND we're a sk PUR TS S', '10', '--none--', 'Active', 'EOREOR') 
Error:
  • 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-03T11:41:00+00:00Added an answer on June 3, 2026 at 11:41 am

    From your generated query:

    'ALICE IN WONDERLAND we're a sk PUR TS S'
                           ^--- unescaped quote
    

    Since you’re doing mysql_real_escape_string() AFTER you generate the query string, you’re NOT escaping the text going into the query, and your query is failing. PHP will not magically reach back in time and rejigger your $query = ... line to reflect the values of the escape call.

    That doesn’t explain why the error message is not being displayed. About all I can think o is that you’ve got multiple connections open to MySQL, and are executing the query on the $connect connection, which is NOT the default connection (e.g. last one created), so the mysql_error() is returning error results from some OTHER connection which has no errors.

    Try mysql_error($connect) and see if you get any error messages.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.