在所有返回行中输入其显示的最后记录

时间:2017-06-07 17:58:55

标签: php mysql sql database jointable

这是我用来连接两个表和显示记录的代码,但是当tab返回并且用户输入它的值时,它会更改所有记录值并在所有行中显示相同

 SELECT tab_issue.tab_tag,tab_issue.tab_imei,tab_issue.person_name,tab_issue.issue_date,tab_issue.project,tab_issue.sim_number,tab_issue.data_ava,tab_issue.asset_charger as issueCharger,tab_issue.asset_powerbank AS issuePowerbank,tab_issue.asset_powercable AS issuePowerbank,tab_issue.asset_powercable AS issuePowercable, tab_issue.asset_cover as issueCover,tab_issue.tab_condition as condition1, tab_return.return_date,tab_return.data_return,tab_return.assetR_charger AS returnCharger,tab_return.assetR_powerbank AS returnPowerbank,tab_return.assetR_powercable AS returnPowercable,tab_return.assetR_cover AS returnCover,tab_return.tab_condition AS condition2
                FROM tab_issue LEFT JOIN tab_return 
                ON tab_issue.project = tab_return.project

在tab_return条目enter image description here出现的数据库表中,单个条目工作正常..图片附上细节

1 个答案:

答案 0 :(得分:0)

好吧,查询错误,我再次阅读并找到解决方案......