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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:49:42+00:00 2026-06-07T04:49:42+00:00

I found the issue and now my insert query works, but I don’t understand

  • 0

I found the issue and now my insert query works, but I don’t understand why. Here is my current working query:

$add_movie = mysql_query("INSERT INTO ownedmovies VALUES ('', '{$movie_data['Title']}',
    '{$movie_data['Year']}', '{$movie_data['Rated']}', '{$movie_data['Runtime']}',
    '{$movie_data['Genre']}', '{$movie_data['Director']}', '{$movie_data['Writer']}',
    '{$movie_data['Actors']}', \"{$movie_data['Plot']}\", '{$movie_data['imdbRating']}')");

Notice that I used double quotes around the plot field and normal around everything else. When I did the plot field the same way as the others, it would not error but nothing would get inserted into the table… now it works perfectly.

Could anyone enlighten me on why this is?

Thank you

  • 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-07T04:49:45+00:00Added an answer on June 7, 2026 at 4:49 am

    I suspect that your plot string contains a single quote. To avoid the problem you should be escaping your string values using mysql_real_escape_string, or (better) use parameterized queries.

    Your “solution” of changing the single quote to a double quote may appear to work in this case, but it will fail if the plot string contains a double quote.

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

Sidebar

Related Questions

EDIT: I've found what's causing the issue, but I don't know why and I
I know this issue has been touched on here but I have not found
I can't resolve this issue, I found a similar question here but: setting the
I've been struggling with this issue for a little while now. Found several posts
Has anyone else had this issue and found a working solution? I've enabled the
I am trying to add a query in my current SQL INSERT INTO statement.
I've been working in Zend Framework for over a year now, but I've never
I've found a strange issue with subclassing and dictionary updates in new-style classes: Python
I found out the next issue in this simple code: let () = print_endline
I've consistently had an issue with parsing XML with PHP and not really found

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.