关联表问题 你认为应该怎么写leftjoin后 然后怎么办? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 文章表 a id title content cid 回复表b cid contentselect a.title,a.content,b.content from a left join b a.cid=b.cid仅供参考 没考虑任何 需求和优化 你可以查询两次1.查询文章id=1的明细select * from article where id=12.查询文章article_id=1的回复select *from comment where article_id=1大概是这么个意思,供参考 select a.title,a.content,b.content from a left join b on a.cid=b.cid看红色部分 我能不能不要2次 我这个要发给客户端呢 我用leftjoin后 怎么渲染呢 这个2次查询效率高点,left join 完全没有必要,你不是还有php的么,在php变量里面拼接 php文件下载中文乱码 加急:php 类似delphi的字符串转字节数组 用file_get_contents("php://input");方法无法得到XML? GB码到UTF码,但服务器不支持iconv()怎么办? 做了个PHP的论坛 遇到一个php版本的问题 PHP文件上传的问题,文件大小发生改变,文件不能正常打开,请高手帮忙! 帮忙看一下我的程序 用PHP+MYSQL如何实现数据管理?~ 请问如何用在php.net下载的patch把老版本php更新到最新版本 请问这是什么编码 推荐适合初学者看的php入门书籍
文章表 a id title content cid 回复表b cid contentselect a.title,a.content,b.content from a left join b a.cid=b.cid仅供参考 没考虑任何 需求和优化
1.查询文章id=1的明细
select * from article where id=12.查询文章article_id=1的回复
select *from comment where article_id=1大概是这么个意思,供参考
看红色部分
这个2次查询效率高点,left join 完全没有必要,你不是还有php的么,在php变量里面拼接