我已经从数据库中检索了整个表作为一个整体并拥有所有值,但是由于发送方和接收方在同一张表上,因此在使用 echo 在我的 html 页面的表上显示它们时出现问题
我试过用
<?php
echo echo $row["u.username"]
?>
和
<?php
echo echo $row["us.username"]
?>
像我在查询中所做的那样将发送方和接收方分开但我收到此错误 注意:未定义索引:us.username in C:\xampp\htdocs\otkoth\status.php 如您所见,我不得不更改我的运输详细信息id 到 sid 以便在表格中显示这是当前的输出
我的表运输详细信息有来自 4 个不同表的 6 个外键要清楚这个查询确实检索数据我的问题但是将我在连接期间使用的列与同一个表中的列分开
SELECT * from shippingdetails s
inner join parcel p on s.parcelid = p.id
inner join offices o on s.officeid = o.id
inner join offices of on s.destinationid = of.id
inner join users u on s.senderid = u.id
inner join users us on s.recepientid = us.id
inner join vehicle v on s.vehicleid = v.id
我希望将买家和接收者分开,然后为起点和目的地复制相同的内容,而不是输出城市名称和位置以使其更逼真
犯罪嫌疑人X
江户川乱折腾