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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:55:18+00:00 2026-06-05T05:55:18+00:00

I need to get some user information from several tables, but if something is

  • 0

I need to get some user information from several tables, but if something is missing like c.comp_title for example the query returns false. How can I make it return any data it finds?

    function one_edu($end_user, $one_id)
    {
    $query_str = "SELECT *
                FROM edu a
                JOIN user_profiles b ON a.user_id=b.user_id
                JOIN (SELECT c.user_id, GROUP_CONCAT(c.comp_title) as comp_title, GROUP_CONCAT(c.comp) as comp
                   FROM comp c
                   GROUP BY c.user_id) c ON a.user_id = c.user_id
                JOIN (SELECT s.user_id, GROUP_CONCAT(s.skill_title) as skill_title, GROUP_CONCAT(s.skill) as skill
                   FROM skills s
                   GROUP BY s.user_id) d ON a.user_id = d.user_id
                JOIN (SELECT t.user_id, GROUP_CONCAT(t.exp_title) as exp_title, GROUP_CONCAT(t.experience) as experience
                   FROM exp t
                   GROUP BY t.user_id) e ON a.user_id = e.user_id
                JOIN (SELECT e.user_id, GROUP_CONCAT(e.edu_title) as edu_title, GROUP_CONCAT(e.education) as education
                   FROM edu e
                   GROUP BY e.user_id) f ON a.user_id = f.user_id
                 WHERE a.user_id = ?";

            $query = $this->db->query($query_str, $end_user);

            if($query->num_rows() > 0)
                    {
                    foreach($query->result_array() as $stuff) {
                            $data[] = $stuff;
                    }
                            return $data;
                    }else{
                            return false;
                    }

    }//end one_edu
  • 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-05T05:55:19+00:00Added an answer on June 5, 2026 at 5:55 am

    Learn about SQL joins. You need to use outer joins – replace JOIN with LEFT JOIN wherever you want results even if the table to be joined has no matching records (or RIGHT JOIN if you want results even if the previously mentioned tables have no matching records).

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

Sidebar

Related Questions

I need to get some information from user by showing a JFrame I need
I need to get some data from a column. For example I have data
I desperately need to be able to get some information from the request array
For my Orchard project, I need some additional information from the user at registration
I am attempting to use ASIHttpRequest with the iPhone to get some information from
I am working so some stuffs where I need to get some information using
Just need get some vals located in application.ini(main ini) in the Controller plugin I
I need to get some external data to form an output file name in
I need to get some random colors to draw a pie. My code works
I need to get one page (can be cURL, or filegetcontent), get some info

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.