我需要制作一个脚本,它将从一个表中获取数据并生成XML或JSON响应。现在,该表包含来自int
值表示的其他表(FK)的数据。
做出一个从其他表中返回FK及其值的响应是否错误?我不确定什么是下注编程实践。
例如,响应可能如下所示(XML)
<item>
<guid>1738291029</guid>
<title>Some title</title>
<link>http://www.site.info</link>
<description>A description</description>
<id>4</id> //FK int from main table!
<category>News</category> //String value from other table!
</item>
在这里,我从链接表返回FK int值及其对应的值。