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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:20:39+00:00 2026-06-15T23:20:39+00:00

I am developing with Codeigniter and when it gets to complicated database queries I

  • 0

I am developing with Codeigniter and when it gets to complicated database queries
I am using

$this->db->query('my complicated query');

then cast to array of object using $query->result();

and so far it’s very good and useful

Now my question is

  1. what if I want to create mysql view and select from it? Will

    $this->db->from('mysql_view')
    

    take the mysql view as it’s a table or not?

  2. And if I do that will be any difference in performance are views faster than normal database query?

  3. What would be best practice with Codeigniter and MYSQL database dealing with complicated queries as I understand that ActiveRecord is just query builder and as some tests it’s even a little slower

Thanks in advance for your advise

  • 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-15T23:20:40+00:00Added an answer on June 15, 2026 at 11:20 pm
    1. MySQL views are queried the same way as tables, on a side note, you can’t have a table and a view share the same name.
    2. Depends on the query you use in the view, views can be internally cached so in the long run – yes, they are faster.
    3. Best practice in this case is to use whatever you find easy to use for yourself and your team, I personally stick to using $this->db->query(); as I find it’s easier to change a simple query of this kind to have some advanced functionality like sub-queries or other things that are hard and/or impossible to do with CI query builder. My advice would be to stick to one way of queries – if you use ->query(), then use them everywhere, if you use a query builder, then use it wherever it is possible to achieve the result using it.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an web app using Codeigniter. In this app I got a
I am developing an app using Codeigniter. In this app I got a form
I'm developing web application using CodeIgniter. All this time, I put the custom js
I am developing an API using Codeigniter and in this API the users can
I'm developing a PHP application using CodeIgniter as the framework, and PostgreSQL as the
Iam developing a site in codeigniter.This is my url http://myserver.net/visio/UBwXo . Here h ttp://myserver.net/visio/
I am developing a web app using Codeigniter and MongoDB. I am trying to
I am developing an API using Codeigniter and MongoDB. I am not sure what
I have been developing a login library for a website using CodeIgniter. The authentication
I'm developing a simple app with a CRUD admin panel, using CodeIgniter. One of

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.