我不知道这是否可能,但这就是我想做的。我有三张桌子
帐户
id | username | pass
汽车
id | plate | id_ac | kilometers // in the id_ac I add manual the id of the car's owner.
旅行
id | plate | places | date | active
现在,我希望当用户登录时,可以看到与他的汽车一起处于活动状态的Trips。所以我想
SELECT from Trips the plate, places, date WHERE active=0 AND id= ? (the logged user's id)
但是餐桌旅行没有车主的ID。因此,我想以某种方式选择已登录用户拥有的汽车的“行程”表的值。
任何想法我怎么能这样做?
慕盖茨4494581
哆啦的时光机