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

  • Home
  • SEARCH
  • 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 9257185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:07:51+00:00 2026-06-18T12:07:51+00:00

Until now i’ve been using prepared statements together with real_escape_string when handling input from

  • 0

Until now i’ve been using prepared statements together with real_escape_string when handling input from HTML forms. Example:

$var1 = $dbconnection->real_escape_string($_POST['varFromForm']); 

if ($insert = $dbconnection->prepare("INSERT etc.. ")) {
    $insert->bind_param('s', $var1);
    and so on..

Although, this messed up the formatting when displaying the stored data by outputting \r\n when new line breaks were used in the textarea of input. This because of it apparently escaped the input twice.

So i want to make sure that i haven’t misunderstood the deal with prepared statements and that this following code IS safe from SQL-injections by using prepared statements without the escaping?

$var1 = $_POST['varFromForm'];

if ($insert = $dbconnection->prepare("INSERT etc.. ")) {
    $insert->bind_param('s', $var1);
    and so on..
  • 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-18T12:07:52+00:00Added an answer on June 18, 2026 at 12:07 pm

    The sql query execution plan of a prepared statement can’t be changed by the parameters, the parameters only can be inserted. So you don’t need to escape variables.

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

Sidebar

Related Questions

Until now I've been used to using DAOs to retrieve information from databases. Other
I'm learning scheme and until now have been using guile. I'm really just learning
Until now, I've been using acts_as_taggable_on plugin for tagging announcements. That plugin creates the
Until now I've been using Indy 10 without issues but after recent problem with
Until now, I've been handling extensions by defining a placeholder element that has name
Until now i have been using a list which keeps track of all unique
Until now I have been using XML parsing in my application, but I recently
Until now, I've been using the <iframe> tag to load things like headers/footers/navbars into
Up until now I have been using: xmlhttp.open(GET,server_script.php?q=+str,true); Thanks Edit: I am providing a
Up until now I have just been using one table in a MySQL query,

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.