基本上,我有一个函数可以将数据导出为 csv 格式的 excel ......我试图有一个查询来选择所选时间段内的所有销售记录,但我需要查询到的第一列来自另一张桌子。我当前的查询如下:
$select = "SELECT `record_date` AS 'Sale Date',
`record_order_number` AS 'Order #',
`record_activity_number` AS 'Activity #',
`record_total_diy_revenue` AS 'Revenue $'
FROM st_entered_records
WHERE `record_user_id` = '$this->user_id' AND
`record_date` BETWEEN '$this->start_date' AND '$this->end_date' ";
前
`record_date` AS 'Sale Date'
我需要它运行第二次选择以获取用户的名字和姓氏格式:
"LastName, FirstName"
(user_last_name)", "(user_first_name) from a second table (st_users)
where `user_id` = '$this->user_id'
任何帮助,将不胜感激!:)