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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:47:31+00:00 2026-05-23T12:47:31+00:00

<?php include ‘dbFunctions.php’; $courseid = $_GET[‘Course_id’]; $query = SELECT * FROM course WHERE Course_id=.$courseid.;

  • 0
<?php
include 'dbFunctions.php';
$courseid = $_GET['Course_id'];

$query = "SELECT * FROM course WHERE Course_id=".$courseid."";
$arrCourse = executeSelectQuery($query);

$query2 = "SELECT * FROM course_member WHERE Course_id=".$courseid."";

$result = mysqli_query($link,$query2) or die(mysqli_error($link));
?>

HTML body:

<?php
while ($row = mysqli_fetch_array($result)) {
?>

      <?php echo $row['member_id']
      ?>

      <?php
}
?>

this correctly prints the results of the member id that is involved in the selected course, however, i want to extract the first_name using the result generated that belong to another table called member.

been trying all the join queries but it didn’t work.

  • 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-23T12:47:31+00:00Added an answer on May 23, 2026 at 12:47 pm

    Sounds like you need to read up on the JOIN operation in SQL. The following query will return all the data you seem to need, from a single query:

    SELECT * 
    FROM course
    INNER JOIN course_member ON course.id = course_member.course_id
    INNER JOIN member ON member.id = course_member.member_id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<?php include db.php; $username=$_POST['username']; $email=$_POST['email']; $query=SELECT * FROM members where username = '.mysql_real_escape_string($username).'; $result=mysql_query($query)or
<?php include('includes/config.php'); $topi = $_GET['id']; //id of url mysql_select_db(ban, $con); $query = SELECT *
<?php include_once('booter/login/includes/db.php'); $query=SELECT * FROM shells; $result=mysql_query($query); while($row=mysql_fetch_array($result, MYSQL_ASSOC)){ $hash = @md5_file($row['url']); echo $hash
This is user.php: include(databse.php);//retrieving successfully first name and lastname from databse file into user.php
Im beginning to learn sphinx search php api after running this query <?php include('sphinxapi.php');
My PHP file: <?php include(ConnectDatabase.php); $Username = mysql_real_escape_string($_POST['Username']); $Password = mysql_real_escape_string($_POST['Password']); $q = mysql_query(SELECT
here is my code for json php include(connect.php); $id = $_GET['lid']; function countRec($fname,$tname) {
Possible Duplicate: PHP - include a php file and also send query parameters Because
My sample index.php include 'class.php'; $x = new class; include $_GET['page'].'.php'; //checks if isset
<?php include 'db_connect.php'; $q = mysql_real_escape_string($_GET['q']); $arr = explode('+', $q); foreach($arr as $ing) {

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.