帮助使用 php & 中的 LEFT JOIN 命令mysql
我想要做的是替换“主题”字段中的所有列&主题的“replyto”中有一个“0”(只要它是0),因为回复时它会留下一个我不喜欢的“RE”东西......所以我只想用匹配0的主题替换它
如何我可以完成这个吗?
$result = mysql_query("
SELECT * FROM mybb_posts
LEFT JOIN mybb_userfields ON (mybb_posts.uid = mybb_userfields.ufid)
WHERE (fid=42) OR (replyto=0)
ORDER BY pid DESC
LIMIT 0,3
");
http://img444.imageshack.us/img444/4964/helpoi.jpg
你可以在泛黄的图片中看到我成功拉取了信息,划掉的主题就是我所说的
图片中的表是“mybb_posts”表
What I wanna do is replace ALL columns in the "subject" field & that has a "0" in "replyto" with the subject ( as long as it is 0) because when replying it leaves a "RE" thing which i dont like... so i just wanna replace it with the subject matching 0
How can I accomplish this??
$result = mysql_query("
SELECT * FROM mybb_posts
LEFT JOIN mybb_userfields ON (mybb_posts.uid = mybb_userfields.ufid)
WHERE (fid=42) OR (replyto=0)
ORDER BY pid DESC
LIMIT 0,3
");
http://img444.imageshack.us/img444/4964/helpoi.jpg
You can see in the yellow-ish picture that i pull the information successfully and the crossed out subject is what i am talking about
The table in the picture is the "mybb_posts" table
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我对MyBB不熟悉,但是前端包含“RE:”吗?或者它实际上来自数据库。我问的原因是,可能只需要对前端文件进行简单的编辑即可删除“RE:”,而不是尝试修改 SQL 查询本身。
I'm not familiar with MyBB, but is the "RE:" included on the front-end? Or does it actually come from the database. The reason I ask is that it may only require a simple edit to the front-end file to remove the "RE:" rather than trying to modify the SQL query itself.