Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索
12
返回列表 发新帖

[已答复] sql里对两个表的查询问题!

[复制链接]
xiaochun1027 发表于 2009-11-27 16:02:41 | 显示全部楼层
supe_housemessage.itemid=supe_houseitems.itemid
回复

使用道具 举报

 楼主| hplxw01 发表于 2009-11-27 16:20:10 | 显示全部楼层
SELECT supe_housemessage.itemid,supe_houseitems.itemid   FROM supe_housemessage,supe_houseitems where supe_housemessage.xz='出租' and supe_houseitems.catid='1'

我试过好多次,怎么弄都不行,帮帮我吧?
回复

使用道具 举报

 楼主| hplxw01 发表于 2009-11-27 16:22:41 | 显示全部楼层
本帖最后由 hplxw01 于 2009-11-27 16:26 编辑

其实我的问题就如如何利用ss模型中的高级模式来对两个表中的字段进行查询,我现在可以读2个表里的数据,但就是记录对不起来

我现在急用!!!

哪个高手能帮帮我?
回复

使用道具 举报

xiaochun1027 发表于 2009-11-27 16:23:44 | 显示全部楼层
回复 12# hplxw01


    SELECT supe_housemessage.itemid,supe_houseitems.itemid   FROM supe_housemessage,supe_houseitems where supe_housemessage.itemid=supe_houseitems.itemid and supe_housemessage.xz='出租' and supe_houseitems.catid='1' ;
试一下吧!
回复

使用道具 举报

 楼主| hplxw01 发表于 2009-11-27 16:31:10 | 显示全部楼层
回复  hplxw01


    SELECT supe_housemessage.itemid,supe_houseitems.itemid   FROM supe_housemess ...
xiaochun1027 发表于 2009-11-27 16:23



    首先谢谢你了,我试过了还是不行,现在是一条记录都不显示。

那继续再试一下,看看到底是哪里的问题。
回复

使用道具 举报

 楼主| hplxw01 发表于 2009-11-27 16:34:42 | 显示全部楼层
应该与subject_li.html.php模板没关系吧?
<!--{loop $iarr $ikey $value}--><div style="line-height:22px;">
  · <a href="$value[url]" target="_blank" title="$value[subjectall]">$value[subject]</a> $value[hx] $value[price] <font color=#4BAB18>#date("n-j", $value[lastpost])#</font></div>
<!--{/loop}-->
回复

使用道具 举报

 楼主| hplxw01 发表于 2009-11-27 16:38:44 | 显示全部楼层
感谢xiaochun1027  !!!!!!

SELECT * FROM supe_housemessage,supe_houseitems where supe_housemessage.itemid=supe_houseitems.itemid and supe_housemessage.xz='出租' and supe_houseitems.catid='1'

这样就可以了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-11-21 19:28 , Processed in 0.085757 second(s), 12 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表