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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:08:12+00:00 2026-06-07T05:08:12+00:00

I am currently attempting to create a fairly basic web app that has the

  • 0

I am currently attempting to create a fairly basic web app that has the potential to hold sensitive(ish) data for users and their organizations.

I had intended on storing all user entered record data in one db and all app data in another db.This data will be stored in a shared db with an user_id and org_id against all records in all tables to facilitate separation.

To minimize risk of code error and data compromise I have researched the ability to automatically append standard ‘where’ statements to my active record queries using Active Record Caching

$this->db->start_cache();
$this->db->where('user_id',$_SESSION['user_id']);
$this->db->where('org_id',$_SESSION['org_id']);
$this->db->stop_cache();

This is brilliant and will save a lot of headaches. However, According to the documentation
http://codeigniter.com/user_guide/database/active_record.html#caching I should also be able to use this for updates (set method):

Note: The following statements can be cached: select, from, join, where, like, group_by, having, order_by, set.

Looking at the active_record class “DB_active_rec.php” there is code present to provide caching in several methods (select, where etc).

if ($this->ar_caching === TRUE)
{
...do caching stuff

From what I can tell this seems to be missing from the set method.

I’m not sure what answer I’m after but hopefully it will be that I’m just doing it wrong!

  • 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-07T05:08:15+00:00Added an answer on June 7, 2026 at 5:08 am

    You can’t cache update statements. It would not make much sense.
    In your update you use the $this->db->where()method, which essentially is a select. That part can be cached, and by doing that you save yourself a select statement.

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

Sidebar

Related Questions

I'm attempting to create Data Access Layer for my web application. Currently, all datatables
I am currently attempting to create a bash script that will check inside of
I'm currently attempting to create a tabbed interface in a web application, and based
I am currently attempting to implement a custom gridview interface to display data from
I am currently attempting to use Lucene to search data populated in an index.
I'm currently attempting to read information about an object from the web.config file and
I am attempting to create a wcf service that accepts any input (Action=*) and
What I am attempting to do is create an application that adds effects to
I am currently attempting to revise a Java Homework program for my Data Structures
I am attempting to create a Dictionary from my DataTable. Currently i do this

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.