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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:18:07+00:00 2026-06-10T18:18:07+00:00

Hello currently working with this code $qry_display = SELECT student_id, fname, sex, lname, mname,

  • 0

Hello currently working with this code

   $qry_display = "
SELECT 
    student_id,
    fname,
    sex,
    lname,
    mname,
    level,
    photo,
    birth_date,
    birth_place,
    address,
    father,
    father_occupation,
    father_phone,
    father_company,
    father_degree,
    mother,
    mother_occupation,
    mother_phone,
    mother_company,
    mother_degree,
    adviser_id 
from 
    tbl_enroll 
where 
    student_id='$id' 
    AND level='$lvl'

";
    $sql_display = mysql_query($qry_display) or die (mysql_error());

The above code fetches most data from tbl_enroll. Now I want to acquire some data on
tbl_er. tbl_enroll and tbl_er are connected with the primary key of student_id , also connect once to tbl_section. tbl_er and tbl_section are connected with the foreign key of section_id.

So far I was thinking of doing multiple sql queries and use one mysql_query trigger but it wont work because the trigger wont work with three sql queries.

  • 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-10T18:18:08+00:00Added an answer on June 10, 2026 at 6:18 pm

    Just JOIN the three tables:

    SELECT t1.*, t2.*, t3.*
    from tbl_enroll t1
    JOIN tbl_el t2 ON t1.student_id = t2.student_id
    JOIN tbl_section t3 ON t2.section_id = t3.section_id
    where student_id='$id' AND a.level='$lvl'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello currently I'm working with this line of code: if( $get_display->level== Nursery){ $lbl=Kinder; }
Hello I currently have this code checking if a cookie exists, it works all
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
Hello I'm currently on Day 2 of Jeffrey Way's Codeigniter tutorial. In this screencast
Hello everyone I'm currently having 2 issues with the code below: Upon return of
Currently I am doing this: I have text that looks like: Hello ${user.name}, this
UPD. Hello, I know how code below is working. I know that cross, and
I'm new to Ruby and am currently working on some practice code which looks
Hello I am currently working on implementing a spatial search feature for a website
Hello all I am currently working on doing some research and was utilizing the

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.