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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:16:40+00:00 2026-06-08T01:16:40+00:00

I was curious to know whether its ok if I user codeigniter’s active record

  • 0

I was curious to know whether its ok if I user codeigniter’s active record query besides using doctrine in some cases, simultaneously. Because in some cases, I find active record more easy and quick way to get things done then writing doctrine query. For example, consider the following case where I need to return total number of rows in a table, in doctrine:

$query = $this->em->createQueryBuilder()
  ->select("count(c)")
  ->from($this->entity, "c")
  ->getQuery();
return $query->getSingleScalarResult();

vs via active record:

return $this->db->count_all_results($this->table);

You can see how easy it is in active record. There may be more such cases. So, is there any pros or cons in using both?

Also, will they use two different db connection to perform their operations?

  • 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-08T01:16:42+00:00Added an answer on June 8, 2026 at 1:16 am

    You can use both Doctrine and ActiveRecord at the same time. Swordfish has highlighted the some problems. In addition to that if you bring in new developer team, the learning curve will be more.

    I suggest choose one and stick with it. IMO, both are equally good. You should choose based on your current project and personal preference. You can find the very good comparison here

    What Does Doctrine Add Above Active Record – CodeIgniter?

    Regarding the two queries you mentioned, if you use DQL, it might look simple

    $query = $em->createQuery('SELECT COUNT(u.id) FROM Entities\User u');
    $count = $query->getSingleScalarResult();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I am just curious to know whether different users can have same user
I am curious to know whether anyone out there have tried mixing node.js headless
I'm just curious to know about this.When i heard about Spring.net and tried some
I'm curious to know whether a Lambda (when used as delegate) will create a
I'm investigating SQLite as a storage engine, and am curious to know whether SQLite
Can I use GPS in J2me enabled phones? I am curious to know whether
I'm curious to know whether the PDFKit framework is available for use within the
I curious to know how the jQuery.load functionality affects page load speeds when reporting
I'm curious to know how the passwords in linux are maintained in /etc/shadow. Even
I'm curious to know why the C# compiler only gives me an error message

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.