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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:14:03+00:00 2026-05-31T18:14:03+00:00

Hello I’m currently on Day 2 of Jeffrey Way’s Codeigniter tutorial. In this screencast

  • 0

Hello I’m currently on Day 2 of Jeffrey Way’s Codeigniter tutorial. In this screencast he said that in the lines below

$sql = "SELECT title, author, contents FROM data
    WHERE id = ? AND author = ?";
    $q= $this-> db-> query($sql, array(1,'jeffrey'));

that if the user inputs anything funny where ‘jeffrey’ is supposed to be, then it’ll be auto escaped, preventing sql injection.

Is this because of codeigniter having it’s own validation in the query() parameters? Or is it in general that binding values to ? prevents sql injection in general?

(The basic understanding I have of SQL injection is that you can type in “jeffrey AND DROP TABLE contents” would kill the table pretty much, or run other bad mysql commands)

  • 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-05-31T18:14:04+00:00Added an answer on May 31, 2026 at 6:14 pm

    CodeIgniter is funny about how it does parameterized queries. Just yesterday we were discussing this similarly and a lot of useful knowledge on the subject can be gathered from this post: CodeIgniter PDO driver uses query instead of prepare? Isn't this less secure?

    The CodeIgniter documentation calls it Query Bindings and has this to say about it:

    The secondary benefit of using binds is that the values are automatically escaped, producing safer queries. You don’t have to remember to manually escape data; the engine does it automatically for you.

    In essence I believe it is a wrapper for PDO::query() that filters input providing proper escaping and quoting prior to making the call.

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

Sidebar

Related Questions

Hello everyone I'm currently having 2 issues with the code below: Upon return of
Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
Hello I am working with a simulator that uses rcS scripts to boot, this
Hello everyone I am trying to resize an image of 700kb with imagecreatefromjpeg. This
Hello good fellas i'm sure everybody is cool.I'm about to start a tutorial about
Hello! I'm not even sure if this is possible, but hopefully it is in
Hello I have been having trouble with this for a while now. I have
Hello guys I need to pass a string array over to a setter that
Hello Guys I am trying to figure out why i am gettings this error
Hello StackOverflow, I'd like to know if there is way to trigger an event

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.