Jump to content

Join


wemustdesign

Recommended Posts

 

I am joining 2 tables. This query word fine:

 

$query = "SELECT site_users.firstName, site_users.telephone, students.places, students.paymentType, students.paymentStatus

"."FROM site_users LEFT JOIN students".

"ON site_users.username = students.user";

 

I now want to only show results that match up to the field $courseID. I tried this but just got an error:

 

$query = "SELECT site_users.firstName, site_users.telephone, students.places, students.paymentType, students.paymentStatus

"."FROM site_users LEFT JOIN students WHERE course = $courseID".

"ON site_users.username = students.user";

Link to comment
https://forums.phpfreaks.com/topic/204570-join/
Share on other sites

Thanks for the reply, that worked:

 

$query = "SELECT site_users.firstName, site_users.telephone, students.places, students.paymentType, students.paymentStatus "."FROM site_users LEFT JOIN students "."ON site_users.username = students.user WHERE students.course = '$courseID'";

Link to comment
https://forums.phpfreaks.com/topic/204570-join/#findComment-1071408
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.