在另一个查询中使用查询结果 [英] Using the results of a query in another query

查看:68
本文介绍了在另一个查询中使用查询结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力创造一个天才。喜欢搜索以便用户可以输入歌曲名称,并且它为您提供了应该匹配的相同类型的歌曲列表。到目前为止,我有一个搜索,它可以返回歌曲标题和艺术家,但我需要的是它采取歌曲的类型(保存在变量中)并进行第二次搜索,将重新生成相同的歌曲列表类型。这是我到目前为止的代码......

I''m trying to create a "genius" like search so that a user can enter a song name and it gives you a list of songs of the same genre that should "match". So far I have a search where it can return the song title and artist but what I need is for it to take the genre of the song (saved in a variable) and do a second search that will reurn a list of songs of the same genre. Here''s the code i have so far...

展开 | 选择 | Wrap | 行号

推荐答案

请使用代码标签。所以我们知道你想做什么。你没有说过你在实现它时遇到了什么问题。
Please use code tags. So we know what you want to do. You haven''t said what problem you''re having in implementing it.


好的,那已经完成了。对不起,我是新来的。基本上,我留下的代码是查询,保存结果的变量和屏幕上的回显。我想要做的是使用
Okay, that''s done. Sorry, I''m new at this. basically, the code I''ve left is the query, the variables where the results are saved and the echo onto the screen. What I want to do is use what''s in the


genre变量中的'',并在第二个查询中使用它,使用搜索到的歌曲标题的类型(它在同一个中)数据库的一行)给出一个相同类型的歌曲列表,并将所述歌曲回显到我的网站页面上。
genre variable and use that in a second query that uses the genre of the song title searched (it''s in the same row of the database) to give a list of songs of the same genre and to echo said songs onto the page of my website.


这篇关于在另一个查询中使用查询结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆