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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:49:54+00:00 2026-05-22T12:49:54+00:00

I have this syntax for grabbing some data from database, I using codeigniter’s active

  • 0

I have this syntax for grabbing some data from database, I using codeigniter’s active record,

$this->db->select('job_id, jobs.employer_id, company_job_id, like_job_id, logo, company_name')
        ->from('jobs')
        ->join('company_likes', 'company_likes.like_job_id = jobs.job_id', 'left')
        ->join('company_views', 'company_views.company_job_id = jobs.job_id', 'left')
        ->join('employers', 'employers.employer_id = jobs.employer_id', 'left');

        $query = $this->db->get();

        return $query->result_array();

No this should be return 1 result however, it is returning 4 records as that is the number of records in the company_views table, what I am wanting to achieve is that I get returned the number of views in the databsae for that employer, but I only want to do it using one query.

Currently this query is used to get the employer details to the user, but I also want to feed back how many times the emloyer has been viewed.

  • 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-05-22T12:49:55+00:00Added an answer on May 22, 2026 at 12:49 pm

    try adding $this->db->group_by('company_views.company_job_id')

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

Sidebar

Related Questions

I have this syntax which works (since it's from the API, pretty much) <%
I have a file that contains parameters using this syntax RANGE {<value> | <value>-<value>}
I have an idea of using this syntax in php. It illustrates that there
I have seen this syntax in MSDN: yield break , but I don't know
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I get this error:- You have an error in your SQL syntax; check the
I have this string 'john smith~123 Street~Apt 4~New York~NY~12345' Using JavaScript, what is the
What I'm doing is grabbing a feed and inserting the data from each of
Can any one help me with this syntax issue with C#? I have no
This syntax for some reason isn't working and I'm wondering why. When I alert

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.