drxkx6149 2013-08-25 12:03
浏览 19

使用JOIN在表中显示数据

I have re written my question as i can not post a new one due to down votes....

as you can tell i was trying to display data in a table format and was wrongly advised to use some code which i was to fault i should have researched the code before using it.

but its a lesson that i have learnt:)

new question

i have taken the answers below to try to rectify the issue and now have a new question based on my origanal one

i am trying to make *clients_id* from the table repair_jobs appear as the name from the table contacts

but i am having no luck i have got 2 sql querices is this worng?

the 1st

$query = "select * from repair_jobs";

this helps me display he informaion i need and works

this is the 2nd

$query = "SELECT repair_jobs.client_id, contacts.name
FROM repair_jobs
INNER JOIN contacts
ON repair_jobs.client_id=contacts.name";

under that i have this to try to display the name of the client

echo "<td>{$client_id}</td>";

but it is only displaying the number and not the data i need

  • 写回答

1条回答 默认 最新

  • doudandui1592 2013-08-25 12:26
    关注

    You are doing something extremely strange.

    I don't understand where did you get that idea of multiple includes, but it is obviously wrong. So, quit it and make your code in 2 files max:

    One to get your data.
    And one to display it.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大