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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:09:50+00:00 2026-06-04T01:09:50+00:00

http://php.net/manual/en/pdo.prepared-statements.php If an application exclusively uses prepared statements, the developer can be sure that

  • 0

http://php.net/manual/en/pdo.prepared-statements.php

If an application exclusively uses prepared statements, the developer can be sure that no SQL injection will occur (however, if other portions of the query are being built up with unescaped input, SQL injection is still possible).

What are the possible scenarios where some of the input is unescaped? Is that even possible if all the other input goes into the database using PDO?

I’m thinking of the scenario where other input is processed with mysql_* functions and not escaped with mysql_real_escape_string. Is there anything else that could be a threat?

Thanks a lot. Regards

  • 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-04T01:09:52+00:00Added an answer on June 4, 2026 at 1:09 am

    It means you cannot use untrusted values directly e.g. as a column or table name – or as a LIMIT parameter.

    For example, this is safe:

    $query = "SELECT * FROM tbl WHERE col = ?";
    

    while these aren’t:

    $query = 'SELECT * FROM tbl WHERE col = ? LIMIT ' . $_GET['limit'];
    $query = 'SELECT * FROM tbl WHERE ' . $_GET['field'] . ' = ?';
    $query = "SELECT * FROM tbl WHERE col = ? AND othercol = '" . $_GET['other'] . "'";
    $query = 'SELECT * FROM ' . $_GET['table'] . ' WHERE col = ?';
    

    Basically, prepared statements’ placeholders are meant to be used in places where you would have used an escaped value within single quotes in a classical query.

    In case you wonder why databases usually do not support placeholders for things like table names: Besides the fact that dynamic table/column names are not that common, the database engine usually optimizes a prepared statement when it’s prepared. This however cannot be done properly without knowing exactly which tables/columns are accessed.

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

Sidebar

Related Questions

http://php.net/manual/en/function.trim.php The manual entry does say that I can remove any specified leading or
Can one use the php DOM class - http://php.net/manual/en/book.dom.php to generate form elements?.
PHP Doc (http://php.net/manual/en/language.operators.bitwise.php) clearly states: ~ $a Not Bits that are set in $a
How can I accomplish http://php.net/manual/en/function.call-user-func-array.php in ruby? So I can do this: class App
From perusing the comments at http://php.net/manual/en/function.set-include-path.php , it seems to me that '.', or
http://php.net/manual/en/function.mysql-escape-string.php Why is that?
http://php.net/manual/de/function.memory-get-peak-usage.php point out that by default the value from emalloc() (memory manager written in
I wanted to try out an example you can find here: http://php.net/manual/en/function.include.php , but
I am new to PHP regex, and I read the http://php.net/manual/en/function.preg-match.php . but can't
from http://www.php.net/manual/en/class.pdo.php ###### config.ini ###### db_driver=mysql db_user=root db_password=924892xp [dsn] host=localhost port=3306 dbname=localhost [db_options] PDO::MYSQL_ATTR_INIT_COMMAND=set

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.