我能够join
从2 个表中获取信息,以便输出哪些用户说哪些状态。它设法获取用户状态tbl_status
和谁说它的用户名tbl_users
。
但现在我还想在状态更新旁边添加用户照片,并在同一个查询中输出该信息。毫不奇怪,用户照片包含在tbl_photos
.
如何将此附加查询添加到现有输出中以输出最后一个查询的结果?
$result = mysql_query("SELECT tbl_status.id as statID, tbl_status.from_user as statFROM, tbl_status.status as statSTATUS, tbl_status.deleted as statDEL, tbl_status.date as statDATE, tbl_users.id as usrID, tbl_users.name as usrNAME FROM tbl_status INNER JOIN tbl_users ON tbl_status.from_user = tbl_users.id WHERE tbl_status.deleted = '0'");