我试图从我的数据库中选择3个表,但我无法获得所需的所有信息。
这是我使用的查询:
$sql=mysqli_query($conn, "
SELECT s.db_id as sub_id
, s.db_username
, s.db_pass
, s.db_subcompany
, s.db_classid
, s.db_companyid
, l.db_class
, l.db_id as cl_id
, c.db_company
, c.db_id as c_id
FROM tbl_subcompany s
JOIN tbl_companies c
ON c.db_id = s.db_companyid
JOIN tbl_class l
ON l.db_id = s.db_classid
ORDER
BY l.db_class ASC;
")or die(mysqli_error($conn));