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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:42:30+00:00 2026-05-17T16:42:30+00:00

In my project I use $this->input->(get|post) to pass data to models. In models I

  • 0

In my project I use $this->input->(get|post) to pass data to models. In models I always use active records.
Is this enough to prevent sql injections ?

  • 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-17T16:42:30+00:00Added an answer on May 17, 2026 at 4:42 pm

    No, it isn’t. Edit: Yes it is…didn’t see your comment about you using active records. You either need to escape your inputs manually using PHP’s or CodeIgniter’s escaping functions or you should be using CodeIgniter’s query bindings or you can use CodeIgniter’s Active Record class. I prefer to do the query bindings as it a) makes my queries look nicer and b) ensures that all of my inputs are cleansed prior to being run in MySQL.

    http://ellislab.com/codeigniter/user_guide/database/queries.html

    This works like this:

    $qStr = "SELECT * FROM students WHERE id=?";
    $q = $this->db->query($qStr, array($id);
    

    CodeIgniter will recognize what type of data your variable is, and wrap it accordingly. That is, if it’s a string, it will put ' and ' around the escaped value in the SQL, which is what you need to ensure that users can’t inject anything malicious.

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

Sidebar

Related Questions

Duplicate post, see: When do you use the "this" keyword? On almost every project
I'm duty-bound by policy to use CVS in this certain project, so even though
I'm trying to use System.DirectoryServices in a web site project and I'm getting this
I have a handful of projects that all use one project for the data
I get the following errors when I try to build this project: error C2182:
My test project consists of a set of input data files which is fed
I'm working on a c# project where I get input from Office documents, and
I see this often in the build scripts of projects that use autotools (autoconf,
This question is about best use scenarios in projects with ORMs like NHibernate, Subsonic,
I'm looking for a python project to use as example to copy the design

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.