我目前有两个表(主表和修订表),我正在试图找到一种更简单的方法(而不是一个很长的php脚本)来显示最新的两个条目之间的差异。我基本上有一个表,我显示每两行的差异。
使用者
| ID|名字|姓|生物|国家|地位|
| --------------|--------------|--------------|--------------|--------------|--------------|
| 1|约翰|史密斯公司|在这里说几句。|美国|活动|
| 二|杰克|琼斯|布拉布拉|英国|待定|
用户_修订
| ID|用户ID|名字|姓|生物|国家|地位|
| --------------|--------------|--------------|--------------|--------------|--------------|--------------|
| 1| 1|乔恩|史密斯公司|在这里说几句。|加拿大|活动|
| 二|1|乔恩|史密斯公司|在这里说几句。。|美国|活动|
| 三|1|约翰|史密斯公司|在这里说几句。额外的|美国|活动|
| 四个|1|约翰|史密斯公司|在这里说几句。|美国|活动|
| 五|1|约翰|史密斯公司|在这里说几句。|英国|活动|
| 六|1|约翰|斯米特|在这里说几句。|美国|待定|
| 七|1|约翰|史密斯公司|在这里说几句。|美国|活动|
我每次都显示表的最后两个条目并突出显示差异,但我相信可以更快地完成。
例如,我比较了Users_revisions 7 <->6,并在下一行6 5(姓氏+国家+状态)上显示差异(姓氏+状态<->),等等,直到您到达第一个条目并比较Users_revisions 1和Users 1。
| 身份证|名字|姓|生物|国家|地位|
| --------------|--------------|--------------|--------------|--------------|--------------|
| <->七六|- -一种|史密斯·<->斯密特|- -一种|- -一种|活动<->待定|
| <->六五|- -一种|斯密特·<->史密斯|- -一种|美国<->英国|待定<->活动|
等等
1条答案
按热度按时间6yt4nkrj1#
这不是很优雅,但可以帮助你在这个问题!