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

  • Home
  • SEARCH
  • 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 8545289
In Process

The Archive Base Latest Questions

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

I am using codeigniter and PHP to build a web app and there are

  • 0

I am using codeigniter and PHP to build a web app and there are lot of objects that I have to define/use inside models due to large number of queries that I have to execute.
Sometime I have to use same object multiple times inside a loop, for example:

  $dbData = $this->mydb->query($dbQuery);
  if($dbData->num_rows() >0 ){ //check if rows were returned
     $dbResult = $dbData->result();
     foreach( $dbResult as $index => $row){
        $dbArray[$row->JOB_NAME_STG] = $row->REC_LOADED;
    }

In general programming practice you should nullify the objects once they are no longer required but I haven’t been able to find any detail on the best way to ensure that all the objects are nullified avoiding memory leaks for codeigniter or php in general.

Is assigning NULL to an object at the end of the function sufficient?

$dbData = $this->mydb->query($dbQuery);
$dbData = NULL;

Or codeigniter has more efficient way of ensuring that there are no memory leaks.

Should object be nullified inside a loop before using to ensure there is no memory leak?

Any pointers in the direction will be appreciated.
Thanks!!!

  • 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-11T12:45:33+00:00Added an answer on June 11, 2026 at 12:45 pm

    Assigning null makes no sense in:

    1. php >= 5.3
    2. applications, that don’t work for hours

    Do you match both items above?

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

Sidebar

Related Questions

I'm using CodeIgniter (a PHP framework) to build an app, and I have an
I am using codeigniter php MVC framework to develop a web application. I have
I'm using CodeIgniter (because it's awesome) and I have something like: <?php echo anchor(/,
Issue/Question : I'm using CodeIgniter to build an event calendar, and I have included
I have a PHP web application built with CodeIgniter MVC framework. I wish to
I'm using CodeIgniter Framework in order to build a web application as follows. My
I'v built a application using codeigniter and I have a message system that displays
I have a PHP app built on Codeigniter 1.7.2, currently in production and live,
Using Datamapper 1.8.1-dev for PHP's CodeIgniter, I'm trying to build this query to prioritize
I am using Codeigniter to build my project. Here i have some doubts or

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.