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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:32:49+00:00 2026-06-11T13:32:49+00:00

Just read this on Stack overflow and thus left me wondering if SQL injection

  • 0

Just read this on Stack overflow and thus left me wondering if SQL injection is possible through active records in CI.

At most of the places in my project, for user registration and user profile update, I have done SQL insertions like this :

Controller :

$name = $this->input->post('name');
$last_name = $this->input->post('last_name');
$age = $this->input->post('dob');

$user_data = array(
    'name' => $name,
    'last_name' => $last_name,
    'age' => $age
);

$this->user_model->add_user_function($user_data);

Model:

function add_user_function($data)
{
    $this->db->insert('user_table',$data);
    return;
}

Just like the example in the SO link above, is my code vulerable to SQL injection?
Can you give a particular example if it is possible to harm my system, and how can I prevent if it exists.

  • 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-11T13:32:51+00:00Added an answer on June 11, 2026 at 1:32 pm

    There are 2 safety features already provided by CodeIgniter for your case.

    1. XSS filtering for your user input :
      Input Class has second boolean parameter for its methods, which lets you run the input through a XSS filter in case you do not have global xss filter on.

    2. For SQL injections, using binded queries and Active records is safe, it will save you from SQL injections as the framework does all of the work of escaping vulnerable user input. There are few vulnerabilities with Active records, that are reported by users, they are however fixed quickly in suqsequent releases by the CodeIgnitor team ( EllisLabs)

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

Sidebar

Related Questions

I read a few solutions on stack overflow and found this to be the
Thank you for taking the time to read this. I looked over Stack Overflow
I read on another Stack Overflow question that Python was just like Ruby, as
I just read this great answer from BalusC about how to upload files with
I just read this requirement on a job listing: Aware of the pitfalls of
I just read this: http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx I was under the impression that overwriting Object or
I just read this article: http://www.acunetix.com/websitesecurity/upload-forms-threat.htm which discusses some of the security risks involved
I just read this question and stumbled upon the following quote: Scala treats ==
I have just read this in the book OpenCV 2 Computer Vision Application Programming
I've just read this snippet from another answer : When you create a block

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.